Skip to content

Commit

Permalink
Remove log
Browse files Browse the repository at this point in the history
  • Loading branch information
yzang2019 committed Sep 12, 2024
1 parent ea34664 commit 3dec465
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions export_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package iavl

import (
"fmt"
"math"
"math/rand"
"testing"
Expand Down Expand Up @@ -201,7 +202,9 @@ func TestExporter_Import(t *testing.T) {
for {
item, err := exporter.Next()
if err == ExportDone {
fmt.Printf("Export done for %s, going to commit import\n", desc)
err = importer.Commit()
fmt.Printf("Import commit done for %s\n", desc)
require.NoError(t, err)
break
}
Expand All @@ -219,6 +222,7 @@ func TestExporter_Import(t *testing.T) {
require.Equal(t, tree.Size(), newTree.ImmutableTree().Size(), "Tree size mismatch")
require.Equal(t, tree.Version(), newTree.Version(), "Tree version mismatch")

fmt.Printf("Start iterating the tree for %s\n", desc)
tree.Iterate(func(key, value []byte) bool {
index, _, err := tree.GetWithIndex(key)
require.NoError(t, err)
Expand All @@ -228,6 +232,7 @@ func TestExporter_Import(t *testing.T) {
require.Equal(t, value, newValue, "Value mismatch for key %v", key)
return false
})
fmt.Printf("Done iterating the tree for %s\n", desc)
})
}
}
Expand Down
4 changes: 0 additions & 4 deletions mutable_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,6 @@ func (tree *MutableTree) LoadVersion(targetVersion int64) (toReturn int64, toErr
if firstVersion == 0 {
if targetVersion <= 0 {
if !tree.skipFastStorageUpgrade {
tree.Mtx.Lock()
defer tree.Mtx.Unlock()
_, err := tree.enableFastStorageAndCommitIfNotEnabled()
return 0, err
}
Expand All @@ -614,7 +612,6 @@ func (tree *MutableTree) LoadVersion(targetVersion int64) (toReturn int64, toErr
targetVersion = latestVersion
}

fmt.Printf("[Debug] This tree has first version %d and latest version %d\n", firstVersion, latestVersion)
if !tree.VersionExists(targetVersion) {
return 0, ErrVersionDoesNotExist
}
Expand Down Expand Up @@ -647,7 +644,6 @@ func (tree *MutableTree) LoadVersion(targetVersion int64) (toReturn int64, toErr
// Returns the version number of the latest version found
func (tree *MutableTree) LegacyLoadVersion(targetVersion int64) (toReturn int64, toErr error) {
roots, err := tree.ndb.getRoots()
fmt.Printf("[Debug] Found %d roots]\n", len(roots))
if err != nil {
return 0, err
}
Expand Down

0 comments on commit 3dec465

Please sign in to comment.