feat: introduce batched dirty recovery - #74
Open
davidcheng0922 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a batched (“bounded concurrency”) dirty recovery path for the SPDK blobstore to speed up recovery on large metadata regions, controlled via a new spdk_bs_opts.recovery_qd option. It also extends unit coverage to exercise both the legacy serial recovery path and the new batched path.
Changes:
- Add
recovery_qdtospdk_bs_opts, defaulting to 16, and plumb it through blobstore load to select batched vs. serial recovery. - Implement batched dirty recovery in
blobstore.cwith parallel metadata scanning + bounded-concurrency chain replay, followed by a serial commit phase. - Update unit tests to run dirty-shutdown recovery under both serial (
recovery_qd=1) and batched (recovery_qd=8) settings.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
test/unit/lib/blob/blob.c/blob_ut.c |
Refactors dirty shutdown test to run with configurable recovery QD and adds a batched-recovery variant. |
lib/blob/blobstore.c |
Adds recovery_qd option default/copy, selects batched recovery when enabled, and implements the batched recovery pipeline. |
include/spdk/blob.h |
Extends public blobstore options with recovery_qd and updates ABI size assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Scan blobstore metadata with chunk reads and record compact page summaries. Use those summaries to replay metadata chains as batched ranges, while keeping metadata commit serial and reusing the existing used-mask write path. If summary replay cannot be prepared, fall back to standard batched replay. Runtime I/O or validation failures fall back to legacy serial recovery. Longhorn: 12837 Signed-off-by: David Cheng <david.cheng@suse.com>
davidcheng0922
force-pushed
the
issue-12837-batch-dirty-recovery
branch
from
July 7, 2026 07:32
910e106 to
8337f6f
Compare
Comment on lines
4153
to
+4156
| ctx->iter_cb_fn = opts->iter_cb_fn; | ||
| ctx->iter_cb_arg = opts->iter_cb_arg; | ||
| ctx->force_recover = opts->force_recover; | ||
| ctx->recovery_qd = opts->recovery_qd; |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue(s) this PR fixes:
longhorn/longhorn#12837
What this PR does / why we need it:
Batch metadata root discovery and chain replay with bounded concurrency to accelerate dirty recovery on large blobstores. Commit phase remains serial and reuses existing recovery logic for correctness.
Special notes for your reviewer:
Additional documentation or context