Repository navigation
fix: exclude replayed WAL rows after rollout writer restart - #305
Merged
Merged
Conversation
beinan
marked this pull request as ready for review
October 4, 2026 18:45
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.
A worker restart can replay an already-published WAL tail into a new generation when the replay cursor lagged the flush. Azure staging exposed this after a successful parallel merge and worker replacement: the next append produced 516 base rows for 512 unique IDs. Generation watermarks and the one-time migration cutoff cannot recognize the replay under its new generation number.
Persist the observed writer epoch per shard and extend the bounded ID-check cutoff when that epoch changes. Include the active generation, so planning between epoch claim and replay flush remains safe. Keep the cutoff fixed within an epoch so steady-state appends retain the lookup-free path. Existing metadata without an epoch gets one conservative transition check; malformed or regressing epoch metadata fails closed.
The regression explicitly leaves a lagging replay cursor, reopens the same shard, plans before the recovered memtable flushes, and checks that only the new row is appended. It also verifies subsequent generations in that epoch return to the fast path.
Validation: the deterministic replay regression passes, and all ten rollout-append regression tests pass (one opt-in benchmark ignored), including commit-before-drain recovery, legacy fallback watermarks, schema/version checks and revoked-owner publication. All ten CI checks passed, including full Rust tests, etcd-backed HA tests, coverage, clippy, Python tests and three-platform wheel builds. The fixed image is still being built for the Azure repetition before production rollout. Production parallel activation remains off; no further ordinary-worker replacements will occur before validation completes.