Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add skipFastStorageUpgrade to MutableTree to control fast storage upgrade #547

Merged
merged 6 commits into from
Sep 15, 2022

Conversation

adu-crypto
Copy link
Contributor

type MutableTree struct {
	*ImmutableTree                                     // The current, working tree.
	lastSaved                *ImmutableTree            // The most recently saved tree.
	orphans                  map[string]int64          // Nodes removed by changes to working tree.
	versions                 map[int64]bool            // The previous, saved versions of the tree.
	allRootLoaded            bool                      // Whether all roots are loaded or not(by LazyLoadVersion)
	unsavedFastNodeAdditions map[string]*fastnode.Node // FastNodes that have not yet been saved to disk
	unsavedFastNodeRemovals  map[string]interface{}    // FastNodes that have not yet been removed from disk
	ndb                      *nodeDB
	skipFastStorageUpgrade   bool // If true, the tree will work like no fast storage and always not upgrade fast storage

	mtx sync.Mutex
}

Add the skipFastStorageUpgrade field to MutalbeTree.
If skipFastStorageUpgrade is true, neither Load(), LazyLoadVersion(), LoadVersion() nor LoadVersionForOverwriting would try to upgrade fast storage when loading the tree.
This is needed for archive nodes with extremely big db to avoid taking unacceptable long time to upgrade the fast storage

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left one comment

mutable_tree_test.go Show resolved Hide resolved
@adu-crypto adu-crypto marked this pull request as draft September 7, 2022 10:52
@adu-crypto adu-crypto force-pushed the skip-fastnode-upgrade branch from ea25c74 to 7cb9973 Compare September 13, 2022 09:25
@adu-crypto adu-crypto changed the title Add skipFastStorageUpgrade to MutableTree to control fast storage upgrade feat: Add skipFastStorageUpgrade to MutableTree to control fast storage upgrade Sep 13, 2022
@adu-crypto adu-crypto marked this pull request as ready for review September 13, 2022 10:12
@adu-crypto adu-crypto requested a review from a team as a code owner September 13, 2022 10:12
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we will have to push this to a branch without the cosmos-db changes.

@adu-crypto
Copy link
Contributor Author

LGTM, we will have to push this to a branch without the cosmos-db changes.

is this not compatible with cosmos-db? which branch do you suggest pushing to?

@tac0turtle
Copy link
Member

I can handle this part, will start right when this is merged. Would like to get one more review before then

@tac0turtle tac0turtle merged commit fcab556 into cosmos:master Sep 15, 2022
@adu-crypto adu-crypto deleted the skip-fastnode-upgrade branch October 11, 2022 10:28
faddat added a commit to faddat/iavl that referenced this pull request Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants