Skip to content
New issue

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

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

Already on GitHub? # to your account

[FIXED] Consumer skips some messages (WQ / Interest Streams) #6526

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

MauriceVanVeen
Copy link
Member

Consumers could occasionally skip messages given specific message removal patterns. This was most prevalent for WorkQueue and Interest-based streams.

The issue lies in both ss.First and ss.Last being lazy and needing to be recalculated once they are needed. ss.Last was not recalculated before, but it is since #6235 ensuring the subject state remains correct.

However, if ss.Last was overwritten after a new message was ingested into the stream, the ss.lastNeedsUpdate flag was not updated. Which resulted in ss.Last being recalculated to a lower value, skipping over the message with the sequence that was previously ss.Last.

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

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner February 19, 2025 00:34
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM!

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/consumer-skips-messages branch from 7bdd728 to 44c077c Compare February 19, 2025 10:16
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

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 1da5a4e into main Feb 19, 2025
5 checks passed
@derekcollison derekcollison deleted the maurice/consumer-skips-messages branch February 19, 2025 13:38
derekcollison added a commit that referenced this pull request Feb 19, 2025
#6528)

Supporting test for #6526.

Signed-off-by: Neil Twigg <neil@nats.io>
@wallyqs wallyqs changed the title [FIXED] Consumer skips some messages [FIXED] Consumer skips some messages (WQ / Interest Streams) Feb 20, 2025
neilalexander added a commit that referenced this pull request Feb 21, 2025
Includes the following:

- #6524
- #6525
- #6526
- #5424
- #6565
- #6532

Signed-off-by: Neil Twigg <neil@nats.io>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants