feat(kv): read bounded authoritative snapshots after a leader barrier - #799
Merged
Merged
Conversation
skhaz
approved these changes
Sep 20, 2026
Contributor
Author
|
Batch architecture review: inspected the codec, admission, cancellation, ingress binding and forwarding paths; focused authority/relay race tests pass. No production caller of ReadAuthoritySnapshot exists in this PR: only the interface, implementation and tests. Under the current requirement to avoid unused runtime vocabulary, hold this protocol/API until a concrete consumer and its consistency contract land together. Also the description says 32 keys while maxAuthoritySnapshotKeys is 256; maxAuthorityConcurrent is 32. Current main now has LocalSnapshotReader in api/store/kv/snapshot.go, so integrate deliberately rather than replacing that file. |
wolfy-j
force-pushed
the
feat/kv-authority-snapshot-reviewed
branch
from
September 22, 2026 22:44
46b09b8 to
066a3b2
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follower-local KV snapshots can lag an accepted leader write. This PR adds
AuthoritySnapshotReaderto the Raft-backed KV engine: a leader barriers Raft, then returns selected keys (including authoritative absence) from one detached KV publication; followers forward through the existing relay instead of substituting local state.Requests and replies use one versioned wire format with bounded envelopes (up to 256 keys and 64 KiB per reply), canonical key ordering, and strict decoding. Up to 32 authority operations are admitted concurrently. Correlation uses connection-derived ingress identity. Caller cancellation removes pending waiters; if a Raft barrier cannot be canceled, its permit remains held until the future finishes. Leadership and transport failures are operational errors, including a retryable unavailable result when no leader can be resolved.
This is an infrastructure API only. It does not activate Strong naming, change admission policy, or add workspace behavior. The three-node tests exercise real Raft with an in-process relay and synthetic ingress, not production internode/TLS.
Validation on current main:
go test -race ./system/kv/... ./cluster/clustertest/... -count=1,go vet ./system/kv/... ./cluster/clustertest/..., andgit diff --check. AGOARCH=386package test remains blocked by the unchangedsystem/crdt/delta.goconstant-overflow build error; wire lengths are checked before conversion toint.