Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with catch-up all streams subscription where the checkpoint is not committed for hard deleted streams #238

Merged
merged 3 commits into from May 27, 2021

Conversation

slashdotdash
Copy link
Member

Track in-flight events sent to subscribers to ensure that the last seen checkpoint is committed for a subscription. The acknowledgements are correlated with the events sent to the subscriber.

This pull request ensures that a catch-up subscription to all streams will correctly commit the last seen checkpoint even when a stream has been hard deleted which causes gaps in the sequence of event numbers. Previously it was assumed there would be no gaps in the event number sequence so the checkpoint could be determined as "last checkpoint + 1" (1, 2, 3, 4, etc.). However this is not the case when a stream has been hard deleted since its events will also be removed leaving gaps in the "all stream" event number sequence (e.g. 1, 2, 9, 10, 15, 16).

Without this change a catch-up subscription to a stream containing events from another stream that has been hard deleted will not persist the last seen checkpoint once it reaches the position of a hard deleted event. Therefore whenever the subscription restarts it will replay all events from the checkpoint, this will be the position of the first hard deleted event.

@slashdotdash slashdotdash force-pushed the bug/catch-up-subscription-hard-deleted-stream branch from e32bcbd to 0828ecd Compare May 27, 2021 14:43
To ensure that acknowledgements are committed for a subscription based upon the events sent to the subscriber.
@slashdotdash slashdotdash force-pushed the bug/catch-up-subscription-hard-deleted-stream branch from 0828ecd to daffeb0 Compare May 27, 2021 14:45
@slashdotdash slashdotdash changed the title Fix bug with catch-up all streams subscription where the checkpoint is not comitted for hard deleted streams Fix bug with catch-up all streams subscription where the checkpoint is not committed for hard deleted streams May 27, 2021
@slashdotdash slashdotdash merged commit d71bbc6 into master May 27, 2021
@slashdotdash slashdotdash deleted the bug/catch-up-subscription-hard-deleted-stream branch May 27, 2021 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant