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

[FIXED] JetStream catchup may return/delete too much #6213

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

MauriceVanVeen
Copy link
Member

JetStream catchup could have a follower delete too much because it could send too large delete ranges.

This was due to LoadNextMsg being used and not checking if the requested last sequence was exceeded. This could happen if LoadNextMsg was used AND last < state.LastSeq AND there's at least one deleted message at sequence last+1.

Given you have a stream with a message at sequence 1 and 100, with a gap in the middle, there were two issues when requesting only to receive what message is stored at sequence 5 (for example):

  • A delete range would be sent with sequence 5 and number of deletes of 95, this should be 1 delete.
  • If the message at sequence 100 was deleted it would also return the same as above, this should also be only 1 delete.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@derekcollison derekcollison merged commit 7f99c52 into main Dec 4, 2024
5 checks passed
@derekcollison derekcollison deleted the maurice/catchup-deletes-too-much branch December 4, 2024 17:24
wallyqs added a commit that referenced this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants