Skip to content

Conversation

@danog
Copy link

@danog danog commented Nov 11, 2025

Resurrection of #22108

tanmayghai18 and others added 2 commits January 28, 2025 14:25
As mentioned long ago (and roughly outlined) in hashicorp#2791, a limitation on blocking queries is that all K/V entries matching that prefix are returned, even though only 1 key may have changed. This diff adds a new `UpdatesOnly` option, that when set, introduces server-side filtering to remove all keys/entries (from a `Keys()` or `List()` query) that have an old `ModifyIndex`.

It uses `MinQueryIndex` as the threshold here, which follows the effective serialization/deserialization chain: `WaitIndex` --> `index` --> `MinQueryIndex`.
- `WaitIndex` being the client-side parameter, determining the index the "client" waits for on a blocking query
- `index` being the serialized HTTP query parameter representing the `WaitIndex`
- `MinQueryIndex` being the server-side struct (deserialized result of `index`)

While we (potentially?) wait for the streaming backend: https://developer.hashicorp.com/consul/api-docs/features/blocking#streaming-backend to be implemented for KV endpoints, this can be a good stop-gap solution to enable in-memory, incremental scans or queries over a prefix.
@danog danog requested review from a team as code owners November 11, 2025 10:31
@github-actions github-actions bot added the theme/api Relating to the HTTP API interface label Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme/api Relating to the HTTP API interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants