From 3dec465bee4d67f0ded5f95273ec75e6b0e2bba6 Mon Sep 17 00:00:00 2001 From: yzang2019 Date: Wed, 11 Sep 2024 17:43:36 -0700 Subject: [PATCH] Remove log --- export_test.go | 5 +++++ mutable_tree.go | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/export_test.go b/export_test.go index f75effc..8ba1094 100644 --- a/export_test.go +++ b/export_test.go @@ -1,6 +1,7 @@ package iavl import ( + "fmt" "math" "math/rand" "testing" @@ -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 } @@ -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) @@ -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) }) } } diff --git a/mutable_tree.go b/mutable_tree.go index 801bd8f..809bab9 100644 --- a/mutable_tree.go +++ b/mutable_tree.go @@ -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 } @@ -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 } @@ -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 }