Keep catching up when the checkpoint timer fires - #327
Open
pirvudoru wants to merge 1 commit into
Open
Conversation
pirvudoru
force-pushed
the
fix-checkpoint-during-catch-up
branch
from
September 8, 2026 06:47
41f46c2 to
e0cbe9a
Compare
A subscription that was catching up moved to the subscribed state when its checkpoint_after timer fired. With the queue drained it stopped reading, and the next live event matched last_received + 1 because notifications received during catch-up are tracked. That event was sent and acknowledged, so the checkpoint jumped past every unread event between last_sent and the head. Persist the checkpoint but stay in the current state for request_catch_up, catching_up and max_capacity.
pirvudoru
force-pushed
the
fix-checkpoint-during-catch-up
branch
from
September 8, 2026 07:31
e0cbe9a to
cb21b09
Compare
Contributor
|
duplicate of #325 althou this one has unit tests 😄 |
Author
|
@yordis do you think this is a fix worth merging and releasing ? So far so good. will wait until the handler will finish consuming the events |
Contributor
|
I'll leave that to @drteeth. I am merely an outsider |
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.

When
checkpoint_afteris set and the timer fires while a subscription is catching up, the FSM moves tosubscribedand stops reading. Notifications received during catch-up are tracked inlast_received, so the next live event matcheslast_received + 1, gets sent and acknowledged, and the checkpoint jumps past every event betweenlast_sentand the head. We hit this in production twice on a replay from origin: the subscription skipped ~40M events in one step.The fix persists the checkpoint but keeps the current state in
request_catch_up,catching_upandmax_capacity. The added test fails onmaster(receives event 32 instead of 11) and passes with the change.