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] Backport retry mset.ackMsg if removal fails #6519

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

MauriceVanVeen
Copy link
Member

Partial backport of #6140 for v2.10.26+

mset.ackMsg could fail if the clustered stream is behind on applies on this server, but the consumer's ack floor is ahead. In this case checkStateForInterestStream would skip its check floor ahead, never retrying to ack/remove this message again. Which would leave messages around, not being removed even though they could be.

This PR is a partial backport, still doing mset.ackMsg for each individual server instead of via message delete proposals for clustered streams, but allowing to retry if a removal should be done.

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

…6140)

For an Interest or WorkQueue stream messages will be removed once all
consumers that need to receive a message have acked it.

For a clustered stream each consumer would ack and remove a message by
themselves. This can be problematic since that introduces different
ordering between servers. For example when using DiscardOld with
MaxMsgs, which could result in stream desync. Proposing the message
removal ensures ordering between servers.

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

---------

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Neil Twigg <neil@nats.io>
Co-authored-by: Neil Twigg <neil@nats.io>
@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner February 18, 2025 10:34
@MauriceVanVeen MauriceVanVeen changed the base branch from release/v2.10.26 to neil/21026rc4 February 18, 2025 10:39
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

@neilalexander neilalexander merged commit 93f547b into neil/21026rc4 Feb 18, 2025
5 checks passed
@neilalexander neilalexander deleted the maurice/v2.10.26-retry-ack-msg branch February 18, 2025 13:15
neilalexander added a commit that referenced this pull request Feb 18, 2025
Partial backport of #6140 for v2.10.26+

`mset.ackMsg` could fail if the clustered stream is behind on applies on
this server, but the consumer's ack floor is ahead. In this case
`checkStateForInterestStream` would skip its check floor ahead, never
retrying to ack/remove this message again. Which would leave messages
around, not being removed even though they could be.

This PR is a partial backport, still doing `mset.ackMsg` for each
individual server instead of via message delete proposals for clustered
streams, but allowing to retry if a removal should be done.

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

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
Signed-off-by: Neil Twigg <neil@nats.io>
Co-authored-by: Neil Twigg <neil@nats.io>
neilalexander added a commit that referenced this pull request Feb 18, 2025
Includes the following:

- #6507
- #6497
- #6476
- #6511
- #6513
- #6517
- #6515
- #6519
- #6521

Signed-off-by: Neil Twigg <neil@nats.io>
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