Add M10.8a probe handoff schema v12 and store
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (client) (push) Successful in 12m32s
Foundation / checks (network) (push) Successful in 12m17s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 2m2s
Foundation / checks (postgres) (push) Canceled after 3m48s
Foundation / checks (checks) (push) Canceled after 16m29s

ADR-0096, the persistence handoff ADR (EXPERIMENT probes, ADR-0094). Durable
probe records hold one owning region per account, so ownership is unique and
the test inventory is conserved by construction. A fenced transfer state
machine (prepared, staged, committed, aborted) under each caller's exact
region lease returns the recorded outcome on every retry; a commit requires
staging by the destination's current epoch; aborts are durable and only
before commit. handoff_account_control moves account control on a committed
transfer.

A PostgreSQL fault matrix covers restarts at each transition, stale epochs,
failed destinations, partitions and commit/abort races, checking one owner and
the conserved inventory after every scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-06 18:15:49 -04:00
co-authored by Claude Opus 5.5
parent 5728e7682e
commit 6a645ef7e4
18 changed files with 1355 additions and 16 deletions
@@ -39,6 +39,13 @@ claim_account_control(Postgres& db, RegionKey key, const LeaseGrant& lease, cons
renew_account_control(Postgres& db, RegionKey key, const LeaseGrant& lease, const Uuid& account,
std::uint64_t generation, std::chrono::milliseconds duration,
std::chrono::milliseconds timeout);
// M10.8 (ADR-0096, schema v12): takes control of `account` for `session` on the strength of
// probe transfer `transfer` committed to the caller's region (no serial: a handoff ticket
// has none). Fenced unless that transfer is committed to this region for this account.
[[nodiscard]] std::expected<AccountControlClaim, ControlStoreFailure>
handoff_account_control(Postgres& db, RegionKey key, const LeaseGrant& lease, const Uuid& account,
const Uuid& transfer, std::uint64_t session,
std::chrono::milliseconds duration, std::chrono::milliseconds timeout);
// True when released, false when control had already moved on.
[[nodiscard]] std::expected<bool, ControlStoreFailure>
release_account_control(Postgres& db, RegionKey key, const LeaseGrant& lease, const Uuid& account,