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] Multi-Filtered Consumers #5274

Merged
merged 2 commits into from
Apr 4, 2024
Merged

Conversation

derekcollison
Copy link
Member

This change introduces a new LoadNextMsgMulti into the store layer. It is passed a sublist that is maintained by the consumer. The store layer matches potential messages across any positive match in the sublist.

Resolves: #4888

Signed-off-by: Derek Collison [email protected]

@derekcollison derekcollison requested a review from a team as a code owner April 3, 2024 23:21
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 but wonder if we should consider #5275 for testing new functionality like this.

Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

Looks good!

Though I have one doubt which I commented about.

// Check if we are multi-filtered or not.
if o.filters != nil {
sm, sseq, err = store.LoadNextMsgMulti(o.filters, o.sseq, &pmsg.StoreMsg)
} else if o.subjf != nil { // Means single filtered subject since o.filters means > 1.
Copy link
Member

Choose a reason for hiding this comment

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

There are quite few implicit assumptions and relations here:

  1. That o.filters == nil means single or none filtesrs.
  2. That o.subjf != nil means signel filter

Thoes are fine, but it's easy to introduce bugs in the future by changing how we update consumers, filters etc.

@derekcollison derekcollison merged commit 3170cc9 into main Apr 4, 2024
4 checks passed
@derekcollison derekcollison deleted the multi-filter-consumers branch April 4, 2024 14:57
derekcollison added a commit that referenced this pull request Apr 4, 2024
Cherry-pick the following PRs into the v2.10.14 release branch:

* #5237
* #5238
* #5242
* #5208
* #5244
* #5248
* #5246
* #5112
* #5247
* #5256
* #5258
* #5264
* #5266
* #5267
* #5265
* #5271
* #5270
* #5272
* #5276
* #5274
* #5275
* #5277
* #5279

Signed-off-by: Neil Twigg <[email protected]>
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.

Performance issues with consumers that have multiple filter subjects
3 participants