Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Dec 22, 2023
1 parent b748a97 commit 3217b74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ func LoadStoreWithInitialVersion(db dbm.DB, logger log.Logger, key types.StoreKe
}

return &Store{
tree: &mutableTree{tree},
tree: &mutableTree{tree},

Check failure on line 83 in store/iavl/store.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use &(mutableTree literal) (value of type *mutableTree) as Tree value in struct literal: *mutableTree does not implement Tree (missing method DeleteVersionsTo) (typecheck)
logger: logger,
}, nil
}

Expand Down
6 changes: 6 additions & 0 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ func (rs *Store) LastCommitID() types.CommitID {

// Commit implements Committer/CommitStore.
func (rs *Store) Commit() types.CommitID {
fmt.Println("calling commit")
var previousHeight, version int64
if rs.lastCommitInfo.GetVersion() == 0 && rs.initialVersion > 1 {
// This case means that no commit has been made in the store, we
Expand All @@ -443,6 +444,7 @@ func (rs *Store) Commit() types.CommitID {
rs.logger.Debug("commit header and version mismatch", "header_height", rs.commitHeader.Height, "version", version)
}

fmt.Println("calling commit stores")
rs.lastCommitInfo = commitStores(version, rs.stores, rs.removalMap)
rs.lastCommitInfo.Timestamp = rs.commitHeader.Time
defer rs.flushMetadata(rs.db, version, rs.lastCommitInfo)
Expand Down Expand Up @@ -594,6 +596,7 @@ func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore {
}

func (rs *Store) handlePruning(version int64) error {
fmt.Println("calling handle pruning")
rs.pruningManager.HandleHeight(version - 1) // we should never prune the current version.
if !rs.pruningManager.ShouldPruneAtHeight(version) {
return nil
Expand All @@ -607,6 +610,7 @@ func (rs *Store) handlePruning(version int64) error {
// If clearPruningManager is true, the pruning manager will return the pruning heights,
// and they are appended to the pruningHeights to be pruned.
func (rs *Store) PruneStores(clearPruningManager bool, pruningHeights []int64) (err error) {
fmt.Println("calling prune stores")
if clearPruningManager {
heights, err := rs.pruningManager.GetFlushAndResetPruningHeights()
if err != nil {
Expand Down Expand Up @@ -639,6 +643,8 @@ func (rs *Store) PruneStores(clearPruningManager bool, pruningHeights []int64) (

store = rs.GetCommitKVStore(key)

fmt.Println("pruning store", "key", key, "height", pruneHeight)

err := store.(*iavl.Store).DeleteVersionsTo(pruneHeight)
if err == nil {
continue
Expand Down

0 comments on commit 3217b74

Please sign in to comment.