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

[IMPROVED] LoadNextMsg for wildcard consumers with millions of subjects #5710

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

derekcollison
Copy link
Member

When LoadNextMsg misses, make sure to consult psim but conservatively.

We had a use case with millions of subjects and the last sequence checked being in the next to the last block. The consumer had a wildcard that matched lots of entries that were behind where we were. This would burn alot of cpu and when a stream had lots of consumers and they shift leadership this would introduce some instability due to all the cpu cycles.

Signed-off-by: Derek Collison derek@nats.io

We had a use case with millions of subjects and the last sequence checked being in the next to the last block.
The consumer had a wildcard that matched lots of entries that were behind where we were.
This would burn alot of cpu and when a stream had lots of consumers and they shift leadership this would introduce some instability due to all the cpu cycles.

Signed-off-by: Derek Collison <derek@nats.io>
@derekcollison derekcollison requested a review from a team as a code owner July 28, 2024 19:58
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

@derekcollison derekcollison merged commit 31d6d64 into main Jul 29, 2024
5 checks passed
@derekcollison derekcollison deleted the skip-first-block branch July 29, 2024 04:40
bruth added a commit that referenced this pull request Jul 30, 2024
Includes the following:

* #5602
* #5672
* #5668
* #5607
* #5687
* #5695
* #5697
* #5704
* #5706
* #5709
* #5710
* #5713
* #5719

Some PRs specifically excluded:

* #5707 — based on a 2.11 NRG
PR
* #5690 — continue to allow
Go 1.20 for 2.10.x
* Various other NRG PRs which are higher risk and destined for 2.11
instead
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