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

Stream Info Pagination Support #153

Open
7 of 13 tasks
aricart opened this issue Sep 19, 2022 · 0 comments
Open
7 of 13 tasks

Stream Info Pagination Support #153

aricart opened this issue Sep 19, 2022 · 0 comments
Assignees
Labels
client Client related work enhancement New feature or request

Comments

@aricart
Copy link
Member

aricart commented Sep 19, 2022

Overview

Stream info requests can now result in paginated responses. The pagination is will trigger if the request includes a subjects_filter, which would include more than 100,000 subject entries in the response. As with other paginated responses, the server will set total, offset, and limit in the response where:

  • total is the length of the dataset
  • offset is the index of the current row where the server started sending data for the request
  • limit is the server set limit on the length of the data set that it will return in a single response.

Note that, unlike other responses, this is still a StreamInfo response, the paged data is the StreamInfo.state.subjects.

To handle the paging, the client can compare the total and limit fields and keep track of all the totals seen. It could also count the number of entries in the subjects map for each request until it accounts for at least the total number of entries. Note that total could change (increase or decrease) if subjects are added or deleted, so the client should update the value returned by the server with each page request.

Also, note that each request is a complete StreamInfo request, only the subject information is paged. The client should return the body of the StreamInfo read from the last paged response after aggregating all the subjects entries in this last response to include all values read by the previous pagination requests.

Clients and Tools

Other Tasks

  • docs.nats.io updated @jnmoyne
  • Update ADR to Implemented
  • Update client features spreadsheet

Client authors please update with your progress. If you open issues in your own repositories as a result of this request, please link them to this one by pasting the issue URL in a comment or main issue description.

@aricart aricart added enhancement New feature or request client Client related work labels Sep 19, 2022
@ripienaar ripienaar removed their assignment Sep 20, 2022
@piotrpio piotrpio removed their assignment Sep 20, 2022
kozlovic added a commit to nats-io/nats.c that referenced this issue Sep 20, 2022
When the option jsOptions.Stream.Info.SubjectsFilter is specified,
the js_GetStreamInfo() would collect the subjects for the stream
and return them in si->State.Subjects. However, the server had
a 100,000 limit. Since server v2.9.0, pagination is supported
therefore this call is going to under the cover get the info
until all pages have been collected.

Related to nats-io/nats-architecture-and-design#153

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@scottf scottf removed their assignment Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client related work enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants