-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Implement general-purpose pagination functionality in KV API #2168
Comments
Any news on this? It seems incredible that such a feature does not exist while filtering does. |
Can I pick this one? |
Hi @vnktram, Thanks for volunteering to contribute to Consul! Give me a bit of time to seek the Consul team's perspective on this first - I'll update you next week. |
Thank you for your interest in implementing this feature! I think before we review any implementation it would be good to outline how the problem will be solved. Implementing pagination in Consul is more difficult than it might be in other systems. One of the challenges is that Consul does not use sequential IDs. The KV entries are indexed by the key name. The keys could change between requests, which could lead to duplicate or missing keys in the response. One option for solving this problem might be to use the Another challenge is how to query the state store. We currently do not index by If you are interested in picking up this issue, we'd encourage you to first write up a design for the solution (either as a comment in this issue, or as a new issue). The design should cover how the above two challenges will be addressed, and also detail how the new HTTP API query parameters will work, and if there is any interaction with existing API query parameters. That write up will make it much easier for us review any pull requests that implement this feature. |
@dnephin Ack. Let me document the proposed design with your suggestions in mind and share it shortly. |
Key hierarchies can grow to be quite large,and this introduces unnecessary and undesirable latencies during retrieval. It would be very nice if the KV API supported pagination. This could be done in a backwards-compatible fashion via query params (possibly something along the lines of)
Ordering would also generally be useful; adding
would sort the results by the lexicographical ordering of the keys under
sample-key
.This could also be integrated consistently with
recurse
by performing a depth-first traversal of the keys in range[start, end]
under the provided sort criterion and returning that set.Thanks!
Josiah
The text was updated successfully, but these errors were encountered: