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
[CHANGED] StreamInfo() will now return all subjects when requested #1072
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the very least you need to update go_test.mod to the latest version of the server so you can benefit from the feature you added in the server. But I think we can get away with reusing StreamInfo() as opposed to add a new function.
2e2bbae
to
5f466c3
Compare
f8225dc
to
200b836
Compare
jsm.go
Outdated
} | ||
|
||
for { | ||
siOpts.Offset = i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changing the behavior in that it makes all StreamInfo request being a non empty request with an Offset (since I don't think this is omitempty). I would set a boolean in the "if" condition above that at least do the offset setting and marshal ONLY if the o.streamInfoOpts is not nil, or maybe rewrite in a way that you deal with simple info where no subject details is asked first, then deal with the cases where subjects are returned.
jsm.go
Outdated
} | ||
|
||
if subjectMessagesMap == nil { | ||
subjectMessagesMap = make(map[string]uint64, total) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, here even if user did not ask for details, you are now creating this map and returning as a resp.StreamInfo.State.Subjects (empty, but non nil map). More reasons maybe to treat the two situations differently, or at the very least do the creation only if map is nil AND the aforementioned boolean is set (indicating that we were asking for subject details)
If a subject filter is specified in the StreamInfoRequest{} option, then all matching subjects will be returned and not be capped to the server limit of 100,000. It is internally using pagination that was added in the server PR: nats-io/nats-server#3454
fde76f6
to
5e2bc56
Compare
79716ec
to
65796fc
Compare
StreamContainedSubjects()
If a subject filter is specified in the StreamInfoRequest{} option,
then all matching subjects will be returned and not be capped to
the server limit of 100,000. It is internally using pagination
that was added in the server PR: nats-io/nats-server#3454