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(v2): async commit #1032

Open
kocubinski opened this issue Dec 31, 2024 · 0 comments
Open

feat(v2): async commit #1032

kocubinski opened this issue Dec 31, 2024 · 0 comments

Comments

@kocubinski
Copy link
Member

An asynchronous commit splits SaveVersion into steps:

(1) mutating the staged tree in memory with a sequence of sets/deletes then calculates the root hash
(2) flushes leaf nodes and (in the case of a checkpoint) branch nodes to disk

(1) is performed synchronously with state machine execution, then (2) is performed in a background thread after returning control to the state machine. The next SaveVersion call to (2) blocks on the completion of the prior (2).

This logic was implemented in earlier version of iavl/v2

func (w *sqlWriter) saveTree(tree *Tree) error {

But removed from nightly builds during the pruning refactor. Implementing this feature should save quite a bit of wall clock time, particularly during checkpoints, but the effects should be benchmarked.

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

No branches or pull requests

1 participant