Skip to content

Commit

Permalink
avoid append commit when upgrade get interrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 14, 2022
1 parent fa2cb40 commit 0f9feeb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,14 @@ func commitStores(version int64, storeMap map[types.StoreKey]types.CommitKVStore
storeInfos := make([]types.StoreInfo, 0, len(storeMap))

for key, store := range storeMap {
commitID := store.Commit()

last := store.LastCommitID()
var commitID types.CommitID
if last.Version >= version {
last.Version = version
commitID = last
} else {
commitID = store.Commit()
}
if store.GetStoreType() == types.StoreTypeTransient {
continue
}
Expand Down

0 comments on commit 0f9feeb

Please sign in to comment.