diff --git a/cmd/legacydump/legacydump b/cmd/legacydump/legacydump new file mode 100755 index 000000000..cebb0d0dc Binary files /dev/null and b/cmd/legacydump/legacydump differ diff --git a/mutable_tree.go b/mutable_tree.go index 34a2277ec..16e40b89b 100644 --- a/mutable_tree.go +++ b/mutable_tree.go @@ -466,11 +466,11 @@ func (tree *MutableTree) LoadVersion(targetVersion int64) (int64, error) { tree.ndb.opts.InitialVersion, firstVersion) } - if latestVersion >= 0 && latestVersion < targetVersion { + if latestVersion < targetVersion { return latestVersion, fmt.Errorf("wanted to load target %d but only found up to %d", targetVersion, latestVersion) } - if firstVersion <= 0 { + if firstVersion == 0 { if targetVersion <= 0 { if !tree.skipFastStorageUpgrade { tree.mtx.Lock() @@ -556,8 +556,7 @@ func (tree *MutableTree) IsUpgradeable() (bool, error) { if err != nil { return false, err } - hasUpgradedToFastStorage := tree.ndb.hasUpgradedToFastStorage() - return !tree.skipFastStorageUpgrade && (!hasUpgradedToFastStorage || shouldForce), nil + return !tree.skipFastStorageUpgrade && (!tree.ndb.hasUpgradedToFastStorage() || shouldForce), nil } // enableFastStorageAndCommitIfNotEnabled if nodeDB doesn't mark fast storage as enabled, enable it, and commit the update.