(2.14) [IMPROVED] Durable source/mirror consumer soft reset - #8323
(2.14) [IMPROVED] Durable source/mirror consumer soft reset#8323MauriceVanVeen wants to merge 5 commits into
Conversation
|
@claude, review. |
|
Claude finished @MauriceVanVeen's task in 7m 36s —— View job PR Review
Overall: Sound design, good test coverage. One behavior change to verify ( See inline comments and the review summary comment for details. |
|
Claude finished @MauriceVanVeen's task in 6m 5s —— View job PR Review: (2.14) [IMPROVED] Durable source/mirror consumer soft resetTasks:
SummaryThis PR delivers two well-scoped improvements: a smarter Findings1.
|
Review SummaryThe two changes here are well-motivated and cleanly implemented. Idempotent pending recalculation ( One thing to verify: the refactor moved Durable sub kept alive across resets (
See inline comments for: a No blocking issues. The test coverage (four new tests covering pre-existing sub, teardown+rebuild, and the source-side analogues) is a solid addition. |
02f44aa to
11e522f
Compare
|
Downloads.zip
|
|
Otherwise this tests fine. (for the durable case) |
Having a stable delivery subject is one, but the fundamental issue is that the "old style" ephemeral consumers have an Only a durable consumer keeps the same delivery subject and isn't removed, so there this optimization can be used. I don't think the "old style" ephemeral case can be improved much, and even if we would some edge cases would remain, whereas the "new style" durable consumers don't have any of these issues. |
|
I'll move this PR to ready for review, since it's confirmed to work as intended for the new durable sourcing consumers. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11e522fdd4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3368e6c to
15c1e9c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15c1e9cf21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@claude, brief re-review. |
|
Claude finished @MauriceVanVeen's task in 4m 30s —— View job Brief Re-review: (2.14) [IMPROVED] Durable source/mirror consumer soft resetTasks:
Since the last review, three meaningful commits landed. Here's what changed and how it looks. Commit 15c1e9c — Durable mirror/source tear down on AckFlowControl mismatchThis directly addresses the Codex P2 concern. Both mirror and source paths now call
After cancellation, One note on sequencing: Commits 28c667f + ce0d819 — Heartbeat-triggered durable consumer resetsThese implement the core motivation of this PR: near-immediate recovery via heartbeat. The change is clean: // Before:
needsRetry = true
mset.retrySourceConsumerAtSeq(si.iname, si.sseq+1)
// After:
needsRetry = !si.sip
...
if needsRetry {
mset.retrySourceConsumerAtSeq(si.iname, si.sseq+1, false) // soft reset
}Two things working together here:
The stall detection path ( Previously raised items — current status
OverallThe new commits are clean and address the open items from the previous review. No blocking issues. The core invariants hold: |
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
…ismatch Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
15c1e9c to
e788977
Compare
This PR contains two improvements to how durable consumers are used for mirroring/sourcing.
On consumer reset, pending is only recalculated when the starting sequence actually changes or there were pending messages. Repeated resets back to the ack floor (or any other sequence) with no delivery in between are therefore idempotent and recalculate pending only once.
For durable mirror/source consumers the delivery subscription (and its processing goroutine) is created up front and kept alive across resets. An idle heartbeat can now trigger a reset, so after a disruption (e.g. a server restart) recovery is near-immediate instead of waiting on the retry loop's backoff.