Repository navigation
Fix subscription WAL replay cursor boundaries - #18810
Merged
jt2594838 merged 2 commits intoOct 10, 2026
Merged
Conversation
jt2594838
approved these changes
Oct 10, 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
The subscription replay cursor stores the next local search index to read.
seekToBeginning()used the empty-WAL sentinel0, although valid local indexes start at1. Replaying the first local record therefore reported an unavailable[0, 1)range and incrementedwalGapSkippedEntriesdespite delivering the record. At the other boundary,AT_ENDreplay lookup andseekToEnd()used the last written index, allowing the tail record to be reread and exposing a one-entry raw WAL gap.Use
FIRST_CONSENSUS_SEARCH_INDEXfor beginning seeks and the index after the last written record for end positions. Preserve per-writer recovery progress and replay of follower records without a local search index. Real missing local indexes remain counted.Add public-API seek regression tests that run seek reset and replay through an isolated, real prefetch worker, with mocked WAL input. They verify delivered timestamps, the next read cursor, and the cumulative skipped-entry counter for the first local record, a preceding follower record, and a retained WAL beginning at local index
3.Verification
0versus1for the no-gap cases and2versus3for missing local indexes1and2.git diff --checkpassed.This PR has:
Key changed/added classes in this PR
ConsensusPrefetchingQueueConsensusPrefetchingQueueTestConsensusPrefetchingQueueSeekTest