Skip to content

Commit 11fa022

Browse files
committed
Fix edge case
1 parent ddd967b commit 11fa022

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ss/pebbledb/db.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ import (
55
"encoding/binary"
66
"errors"
77
"fmt"
8-
"github.com/sei-protocol/sei-db/common/logger"
9-
"github.com/sei-protocol/sei-db/common/utils"
10-
"github.com/sei-protocol/sei-db/stream/changelog"
118
"math"
129
"strings"
1310
"sync"
1411

1512
"github.com/cockroachdb/pebble"
1613
"github.com/cockroachdb/pebble/bloom"
1714
errorutils "github.com/sei-protocol/sei-db/common/errors"
15+
"github.com/sei-protocol/sei-db/common/logger"
16+
"github.com/sei-protocol/sei-db/common/utils"
1817
"github.com/sei-protocol/sei-db/config"
1918
"github.com/sei-protocol/sei-db/proto"
2019
"github.com/sei-protocol/sei-db/ss/types"
20+
"github.com/sei-protocol/sei-db/stream/changelog"
2121
"golang.org/x/exp/slices"
2222
)
2323

ss/store.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package ss
22

33
import (
44
"fmt"
5-
"github.com/sei-protocol/sei-db/ss/pruning"
65

76
"github.com/sei-protocol/sei-db/common/logger"
87
"github.com/sei-protocol/sei-db/common/utils"
98
"github.com/sei-protocol/sei-db/config"
109
"github.com/sei-protocol/sei-db/proto"
10+
"github.com/sei-protocol/sei-db/ss/pruning"
1111
"github.com/sei-protocol/sei-db/ss/types"
1212
"github.com/sei-protocol/sei-db/stream/changelog"
1313
)
@@ -86,7 +86,7 @@ func RecoverStateStore(logger logger.Logger, changelogPath string, stateStore ty
8686
// Look backward to find where we should start replay from
8787
curVersion := lastEntry.Version
8888
curOffset := lastOffset
89-
for curVersion > ssLatestVersion && curOffset >= firstOffset {
89+
for curVersion > ssLatestVersion && curOffset > firstOffset {
9090
curOffset--
9191
curEntry, errRead := streamHandler.ReadAt(curOffset)
9292
if errRead != nil {

0 commit comments

Comments
 (0)