fix(meta): gate snapshot backfill merge on pending barriers#26288
Open
wenym1 wants to merge 2 commits into
Open
fix(meta): gate snapshot backfill merge on pending barriers#26288wenym1 wants to merge 2 commits into
wenym1 wants to merge 2 commits into
Conversation
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.

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Snapshot-backfill jobs currently merge into the database graph as soon as every backfill executor starts consuming upstream. If the independent partial graph still has a large replay-barrier backlog, replacement actors can then spend a long time waiting for their state-table epochs to commit and stall database streaming.
This PR delays the merge until the creating job's pending barrier count is within a configurable limit. The count includes in-flight barriers, collected barriers awaiting completion, and the checkpoint currently completing. The pending count is carried with collected-barrier events so a checkpoint is forced only when the job is actually eligible to merge; the merge path rechecks the live count at the checkpoint opportunity.
The new
snapshot_backfill_finish_max_lagged_barriersstreaming option defaults to 100. CI overrides it to 5 to exercise the gated path more frequently.Checklist
Documentation
Release note
Snapshot-backfill jobs now wait for their independent barrier backlog to fall below a configurable limit before merging into the database streaming graph. This reduces long streaming stalls during snapshot-backfill completion. The limit can be configured with
streaming.snapshot_backfill_finish_max_lagged_barriersand defaults to 100.