Skip to content

[IMPROVED] Interest desync after consumer create/update#7440

Merged
neilalexander merged 1 commit intomainfrom
maurice/no-interest-desync
Oct 19, 2025
Merged

[IMPROVED] Interest desync after consumer create/update#7440
neilalexander merged 1 commit intomainfrom
maurice/no-interest-desync

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

Due to noInterest being determined on individual servers and not only by the leader, this means the stream can desync if a consumer is created or updated such that new interest on published subjects is established at different logical times.

This race condition happens due to the published messages going over the stream layer, whereas consumer creates and updates go over the meta layer. Slower meta layer applies or differing network latencies could then result in "no interest" being marked differently on different servers.

The fix introduced in this PR can be included in a patch version. The desync will still occur, but individual servers can now recognize this and remove messages at the start of the stream that have no interest. But, technically this does not solve the core issue of the ordering differences between the meta and stream layer. There can be multiple ways to solve that, but will likely need to wait for 2.14+. If the consumer assignments are managed by the stream, and those assignments go over the stream layer, then this would be a better way to ensure consistency without needing to fix things up later.

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

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner October 17, 2025 13:00
Copy link
Copy Markdown
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 e6b8cd0 into main Oct 19, 2025
110 of 114 checks passed
@neilalexander neilalexander deleted the maurice/no-interest-desync branch October 19, 2025 16:10
neilalexander added a commit that referenced this pull request Oct 30, 2025
Includes the following:

- #7435
- #7433
- #7436
- #7443
- #7440
- #7444
- #7452
- #7455
- #7458
- #7465
- #7466
- #7474
- #7469
- #7460
- #7449
- #7484
- #7479
- #7486
- #7495
- #7482
- #7496

Signed-off-by: Neil Twigg <neil@nats.io>
neilalexander added a commit that referenced this pull request Nov 12, 2025
Includes the following:

- #7535
- #7536
- #7538
- #7539
- #7440
- #7543

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