Repository navigation
[Subscription] Fix stalled WAL replay retries across file refresh and rotation - #18919
Merged
jt2594838 merged 1 commit intoOct 20, 2026
Merged
Conversation
jt2594838
approved these changes
Oct 20, 2026
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.
Description
Subscription WAL replay can remain in
WAITING_FOR_READABLE_WALindefinitely after a reader-open failure: refreshing the file list filters out a sealed header-only WAL, but the retry path keeps waiting for that version to reappear. Rotation can also pair an old file with metadata from its successor because the writer and current-version fields are published separately.This change:
Adds regression coverage for filtered empty files, temporarily missing active files, confirmed missing historical files, truncated reopen offsets, header-only truncation, and rotation during metadata capture. The WALBuffer test also covers the interval between publishing a successor writer and publishing its version.
Validation
test-compilepassed in English and with-Pwith-zh-locale(53 modules each).ConsensusPrefetchingQueueWalBackpressureTest.testWalGapRecoveryPreservesFollowerBeforePendingBoundary, was reproduced with the unmodified production sources and test class from base commit4c34a253927: the same memory assertion expects 1318 bytes and observes 0. Its assertion is unchanged in this PR.git diff --check, locale key parity, and the new messages' placeholder/hash checks passed.The original long-running workload has not been rerun with this patch. This PR addresses reproducible retry-state defects; it does not establish that every replay stall under memory pressure has the same cause.
Review checklist
Key classes:
ProgressWALIterator,WALBuffer,WALNode,ConsensusPrefetchingQueue.