Skip to content

feat(v2): async commit #1032

@kocubinski

Description

@kocubinski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions