Skip to content

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

Merged
tac0turtle merged 6 commits into
cosmos:masterfrom
adu-crypto:skip-fastnode-upgrade
Sep 15, 2022
Merged

feat: Add skipFastStorageUpgrade to MutableTree to control fast storage upgrade#547
tac0turtle merged 6 commits into
cosmos:masterfrom
adu-crypto:skip-fastnode-upgrade

Conversation

@adu-crypto
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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

Comment thread mutable_tree_test.go
@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 September 13, 2022 10:12
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
Contributor

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

Development

Successfully merging this pull request may close these issues.

3 participants