Complete M7.3 fenced region ownership

ADR-0060 and schema v2 add database-time region leases and a fenced head
advance. Acquire/renew/release/advance lock the lease row, check holder,
epoch and expiry with clock_timestamp() after the lock wait, and the
advance compares the exact predecessor. Holders are DB-generated tokens;
epochs never wrap or repeat. The runtime group role gets EXECUTE on five
SECURITY DEFINER functions only - no table, provisioning or CREATE rights.
Migration history admits clean->v2, v1->v2 and a v2 no-op, and refuses
privileged runtime roles.

Host side: portable LeaseAuthority fences from send-time deadlines on
CLOCK_BOOTTIME, keeps the earlier deadline on unknown renewal and stays
fenced until a newer epoch. Selected timings: 20s lease, 5s renew, 2s
margin, 2s renew and 5s commit deadlines. Linux evo::postgres wraps the
functions with typed LeaseStoreError results.

Validated: Windows CTest 55/55; WSL Release, clang-tidy and ASan/UBSan
private-PostgreSQL suites (contenders, expiry, paused/queued stale
writers, unknown renewal, exhaustion, bypass denial, upgrade path).
Three SQL mutations were each caught. Docker/Gitea CI, remote TLS and
cluster runs were not executed. No director, host or deployment added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-28 11:14:32 -04:00
co-authored by Claude Opus 5.5
parent 598b3938e6
commit 2496649a9b
22 changed files with 1501 additions and 29 deletions
+14
View File
@@ -501,3 +501,17 @@ server/libpq pair, optional persistence adapter and transactional schema v1.
Private PostgreSQL integration checks passed in Release, analysis and ASan/UBSan;
container/cluster verification remains separate. Secret provisioning instructions
are in infrastructure/POSTGRESQL.md. Next: M7.3 fenced region ownership.
M7.3 implemented and locally qualified (2026-09-28). ADR-0060 adds schema v2:
database-time leases, DB-generated holders, never-reused epochs and a fenced head
advance that checks lease then predecessor under one row lock. The runtime role
gets EXECUTE only; table writes, provisioning and object creation are denied.
Real-PostgreSQL tests cover the scenarios the roadmap row requires:
- 64 two-contender acquisition rounds and 32 racing advances;
- expired renewal and a paused stale writer;
- a writer queued past expiry, which is judged by post-lock database time;
- an unknown renewal that fences locally.
Timings were selected and measured locally. The director is intentionally deferred
because it has no authority and would be a placeholder. Next: M7.4 checkpoint
codecs/publication. It must also revoke runtime EXECUTE on the bare head kernel.