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

Improve: build snapshot in anohter task #816

Merged

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented May 2, 2023

Changelog

Improve: build snapshot in anohter task

Before this commit, snapshot is built in the sm::Worker, which blocks
other state-machine writes, such as applying log entries.

This commit parallels applying log entries and building snapshot: A
snapshot is built in another tokio::task.

Because building snapshot is a read operation, it does not have to
block the entire state machine. Instead, it only needs a consistent view
of the state machine or holding a lock of the state machine.

Chore: add check.kdl to run local check in parallel

This change is Reviewable

Before this commit, snapshot is built in the `sm::Worker`, which blocks
other state-machine writes, such as applying log entries.

This commit parallels applying log entries and building snapshot: A
snapshot is built in another `tokio::task`.

Because building snapshot is a read operation, it does not have to
block the entire state machine. Instead, it only needs a consistent view
of the state machine or holding a lock of the state machine.

- Fix: databendlabs#596
@drmingdrmer drmingdrmer merged commit d43442f into databendlabs:main May 2, 2023
@drmingdrmer drmingdrmer deleted the 24-parallel-build-snapshot branch May 2, 2023 07:15
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.

Cancel Snapshot Jobs
1 participant