Repository navigation
fix(router): provisional cursor on BatchFlusher poison skip - #86
Merged
olucasandrade merged 5 commits intoSep 28, 2026
Merged
olucasandrade merged 5 commits into
olucasandrade merged 5 commits into
Conversation
Poison skips were advancing the durable cursor immediately, so a mid-window poison could persist past unflushed buffered seqs and lose them after a failed FlushBatch. Route BatchFlusher skips through provisionalByPartition like successful Deliver; keep immediate advance for non-flushers. Introduced-by: 36c9733
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ip-batchflusher-cursor
Deploying kaptanto with
|
| Latest commit: |
6fa1f97
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://da555aa2.kaptanto.pages.dev |
| Branch Preview URL: | https://fix-router-poison-skip-batch.kaptanto.pages.dev |
…ip-batchflusher-cursor
…ip-batchflusher-cursor
…ip-batchflusher-cursor
olucasandrade
deleted the
fix/router-poison-skip-batchflusher-cursor
branch
September 28, 2026 12:25
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.
Source fix plan
.claude/fix-plans/router-poison-skip-batchflusher-cursor-20260924-212132.mdProblem
In
applyDispatchCursors, the RTR-07 poison-skip branch calledadvanceCursorLocked, which advancedcursorByPartitionand queuedSaveCursorimmediately. ForBatchFlusherconsumers,Deliveronly buffers — the durable cursor must move only afterFlushBatchsucceeds via provisional promotion.Trace: durable cursor at 1; poison at seq 3 → skip persisted cursor to 4 while seqs 1–2 were only buffered; flush failure discarded provisional → next read started at 4 → seqs 1–2 lost. Real queue sinks drop their pending buffer on flush failure, so this is an at-least-once violation.
Introduced by
36c9733
Implementation
applyDispatchCursors, BatchFlusher consumers record a poison skip onprovisionalByPartition(same promotion path as a successful bufferedDeliver).advanceCursorLocked.Validation
CGO_ENABLED=0 go test ./internal/router -count=1→ pass (18.5s)go test -race -count=1 -timeout 180s ./internal/router→ pass (22.9s)Residual risk