Skip to content

Comments

[IMPROVED] Consumer interest check with large gap#7656

Merged
neilalexander merged 1 commit intomainfrom
maurice/consumer-interest-ack
Dec 16, 2025
Merged

[IMPROVED] Consumer interest check with large gap#7656
neilalexander merged 1 commit intomainfrom
maurice/consumer-interest-ack

Conversation

@MauriceVanVeen
Copy link
Member

In o.checkStateForInterestStream we used to have a linear scan between the ack floor and the highest delivered sequence. For every message that is not pending, we'd call o.needAck. This is incredibly expensive when there are very large gaps, either due to deleted messages or messages that don't match the filter subjects. Now we rely on the store's LoadNextMsg to efficiently skip over these messages.

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

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner December 16, 2025 12:09
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

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/consumer-interest-ack branch from eb10d51 to 98f95cc Compare December 16, 2025 13:33
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 ceccb6f into main Dec 16, 2025
108 of 114 checks passed
@neilalexander neilalexander deleted the maurice/consumer-interest-ack branch December 16, 2025 14:22
neilalexander added a commit that referenced this pull request Dec 16, 2025
Includes the following:

- #7655
- #7656

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

- #7553
- #7555
- #7579
- #7578
- #7581
- #7585
- #7586
- #7588
- #7593
- #7594
- #7595
- #7596
- #7597
- #7598
- #7601
- #7604
- #7605
- #7610
- #7616
- #7614
- #7622
- #7619
- #7624
- #7625
- #7627
- #7636
- #7637
- #7643
- #7648
- #7634
- #7655
- #7656

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