[IMPROVED] Multi-Filtered Consumers#5274
Merged
derekcollison merged 2 commits intomainfrom Apr 4, 2024
Merged
Conversation
Signed-off-by: Derek Collison <derek@nats.io>
…ects. Signed-off-by: Derek Collison <derek@nats.io>
neilalexander
approved these changes
Apr 4, 2024
Member
neilalexander
left a comment
There was a problem hiding this comment.
LGTM but wonder if we should consider #5275 for testing new functionality like this.
Jarema
reviewed
Apr 4, 2024
Member
Jarema
left a comment
There was a problem hiding this comment.
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. |
Member
There was a problem hiding this comment.
There are quite few implicit assumptions and relations here:
- That
o.filters == nilmeans single or none filtesrs. - That
o.subjf != nilmeans signel filter
Thoes are fine, but it's easy to introduce bugs in the future by changing how we update consumers, filters etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 derek@nats.io