-
Notifications
You must be signed in to change notification settings - Fork 266
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 post-order export & restoring #853
Conversation
Important Auto Review SkippedAuto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation looks good to me, but I think we need to add some tests for it.
@@ -205,13 +204,14 @@ func TestTree_Build_Load(t *testing.T) { | |||
|
|||
// export the tree at version 12,000 and import it into a sql db | |||
ctx := context.Background() | |||
traverseOrder := PreOrder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add test for post-order traversal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, let's have this test run for both pre and post order.
snapshot.go
Outdated
return node, uniqueVersions, err | ||
} | ||
|
||
func (snap *sqliteSnapshot) writeSnapNode(node *Node, version int64, count int) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the write logic may need to change a bit here now, if you pull v2-alpha6
you'll see what I mean. I needed to incorporate an additional flag to accommodate multiple write paths in snapshot.
https://github.com/cosmos/iavl/blob/640a21ec34b532d04886b6de2085c809dca6f343/snapshot.go#L30C1-L31
ref: #852