Skip to content

Commit

Permalink
Fix edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
yzang2019 committed Jun 21, 2024
1 parent ddd967b commit 11fa022
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ss/pebbledb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import (
"encoding/binary"
"errors"
"fmt"
"github.com/sei-protocol/sei-db/common/logger"
"github.com/sei-protocol/sei-db/common/utils"
"github.com/sei-protocol/sei-db/stream/changelog"
"math"
"strings"
"sync"

"github.com/cockroachdb/pebble"
"github.com/cockroachdb/pebble/bloom"
errorutils "github.com/sei-protocol/sei-db/common/errors"
"github.com/sei-protocol/sei-db/common/logger"
"github.com/sei-protocol/sei-db/common/utils"
"github.com/sei-protocol/sei-db/config"
"github.com/sei-protocol/sei-db/proto"
"github.com/sei-protocol/sei-db/ss/types"
"github.com/sei-protocol/sei-db/stream/changelog"
"golang.org/x/exp/slices"
)

Expand Down
4 changes: 2 additions & 2 deletions ss/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package ss

import (
"fmt"
"github.com/sei-protocol/sei-db/ss/pruning"

"github.com/sei-protocol/sei-db/common/logger"
"github.com/sei-protocol/sei-db/common/utils"
"github.com/sei-protocol/sei-db/config"
"github.com/sei-protocol/sei-db/proto"
"github.com/sei-protocol/sei-db/ss/pruning"
"github.com/sei-protocol/sei-db/ss/types"
"github.com/sei-protocol/sei-db/stream/changelog"
)
Expand Down Expand Up @@ -86,7 +86,7 @@ func RecoverStateStore(logger logger.Logger, changelogPath string, stateStore ty
// Look backward to find where we should start replay from
curVersion := lastEntry.Version
curOffset := lastOffset
for curVersion > ssLatestVersion && curOffset >= firstOffset {
for curVersion > ssLatestVersion && curOffset > firstOffset {
curOffset--
curEntry, errRead := streamHandler.ReadAt(curOffset)
if errRead != nil {
Expand Down

0 comments on commit 11fa022

Please sign in to comment.