-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UpdatesOnly query option to fetch data for only changed keys
As mentioned long ago (and roughly outlined) in #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.
- Loading branch information
1 parent
4bca5c5
commit c9997a8
Showing
12 changed files
with
124 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.