Repository navigation
perf(control): prove ownership with one etcd read and keep paged reads stable (3/7) - #546
Merged
Merged
Conversation
Acknowledgement barriers only need to show that no successor can own the shard yet: a successor cannot acquire it while this owner's lease-attached session exists. ControlStore::prove_owner reads the shard record, its recovery state and the owner session in one etcd transaction at one revision, instead of two reads plus a fresh lease keepalive stream. Periodic renewal still extends the lease. The default delegates to renew_owner, so other stores keep their behavior. Signed-off-by: wchwawa <wch19961116@gmail.com>
A full or ranged artifact read loads path metadata and then range-plan pages, and required every page to repeat the complete PathMetadata. PathMetadata carries the workspace revision, which every publication to any other path of the workspace advances, so under concurrent writers an unaffected read restarted until it exhausted its attempts with "artifact metadata changed during a paged read". Fence pages on the immutable revision identity instead: incarnation, path, generation, revision id, dependency shape and descriptor. A changed generation or revision still restarts the read, and callers that need the exact workspace revision keep read_artifact_at_authority. Signed-off-by: wchwawa <wch19961116@gmail.com>
A local-only owner proved owner liveness both before and after executing each request. Only shared publication has work to do before dispatch (repairing an interrupted upload); for local-only the barrier after execution already proves liveness after everything the request observed or wrote, so the earlier proof added a control round trip without fencing anything more. Signed-off-by: wchwawa <wch19961116@gmail.com>
19 of 24 tasks
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.
Related Issue
Relates to #543
Part 3 of 7 of the stack for #543. Stacked on #545 (
perf/stack-2-session-transport); review only the commits below.Summary
ControlStore::prove_ownerreads the shard record, its recovery state, and the owner session in one etcd transaction at one revision, instead of two reads plus a fresh lease keepalive stream. Periodic renewal still extends the lease; other stores keep their behaviour through the default.PathMetadata. Previously, any publication to another path of the workspace restarted the read, until it ran out of attempts with "artifact metadata changed during a paged read".Commits:
4cfb527a09perf(control): prove ownership with one linearizable etcd read2198970862fix(client): keep live paged reads valid while other paths change8ec1684ac9perf(server): prove local-only liveness once per requestScope
object-store, agent interface, or docs change is mixed in.
maintenance task this PR resolves.
Change Size And Review
current-head pusher approved the exact current head commit. Not applicable: under 5,000 lines.
not being used to justify mixed package or lifecycle boundaries.
Code Contract (Code Changes Only)
docs/development/code_contract.md.New generic helper modules are domain-neutral and tested.
errors.rsand carry stable error kinds when crossing package boundaries (no new error types).lifetime, snapshot/commit/event retention, GC epochs, and fail-closed
recovery boundaries. Not applicable: no metadata format or retention change.
RootId -> LogicalShardIdaffinity, one active writer per shard, owner-epoch fencing, and explicit
shard-local atomicity; no split root or cross-shard transaction is implied. (owner-epoch fencing and one active writer per shard are unchanged; the proof still shows no successor can own the shard while this owner's session exists)
nokv-agent, routing and workflows innokv-client, and the concretebackend plus native full CLI wiring in
nokv. Not applicable: no agent-interface change.direct Python SDK second, and the Rust SDK third, and does not present the
deprecated
nokv mcpsidecar as a supported NoKV surface. Not applicable: no user-facing documentation change.Claims and Evidence
planned capabilities. Not applicable: no user-facing documentation change.
authentication or authorization (no security claims).
run count, and raw-evidence location.
An etcd ownership proof costs about 0.2 ms per acknowledged request. This PR has no separate end-to-end number; the stack-level harness results are in #543.
Topology for every number: one laptop (Apple M3 Pro, 36 GiB, macOS, APFS, F_FULLFSYNC), one NoKV owner, RustFS in Docker, etcd or a local control directory, fresh storage per trial. The method, run counts, and harness are in the evidence gist.
Validation
rust.ymlpins:cargo clippy --workspace --all-targets -- -D warningsand the feature clippy runs fromrust.yml(nokv-meta/nokv-benchwithmetadata-read-stats,nokv-meta-holtwithread-stats,nokv-serverandnokv-benchwithrestore-crash-test-support) are clean.49949ddea8(perf/stack-7-time-ordered-ids): 1,209 passed, 0 failed, 13 ignored. They were not rerun on this head.rust.yml, DCO, and change governance run only for PRs intomain, so this PR gets CI once the PR below merges and GitHub retargets it.Contributor Sign-off
Signed-off-bytrailer.