- EngineWindowState: the both-tables ensure_gc_schema (gc_pins with the
(key, owner) identity + gc_window), idempotent window_stage (the
upsert discipline per (key, deadline)), and window_take as one atomic
DELETE ... RETURNING with the <= boundary
- EngineFleetState: PgJointTx (the pooled checkout carrying a
session-level BEGIN), joint_put (the CAS clause inside the held tx),
pin_commit (pin-row upsert-renewals + commit, rollback-on-failure =>
zero residue), pin_renew (expiry = now + DEFAULT_PIN_TTL, never
resurrects), pin_check (the two-variant classification), arbitrate
(the FOR UPDATE finger-lock folding pins + registered liveness-table
references), and the engine-side register_liveness_source home
- The sweep lease: the session-scoped pg advisory lock with the
namespaced FNV lock key and the same-connection acquire/release
holding discipline (the lease's checkout stored until release)
- 13 contract tests (28 postgres tests total), env-driven, skipping
cleanly server-less; verified green against the live pglo-poc
harness server; clippy/fmt green default + --features postgres
Verification: cargo test (69/19/3 ok), cargo test --features postgres
server-less (97 ok, 28 skips) and live (97 ok), cargo test
--all-features (152/54/4 ok), cargo clippy -D warnings (both configs),
cargo fmt --check, cargo doc --no-deps.
Five tasks against the wave-3 contract surface as reviewed (no
amendments from the gate):
- engine-postgres: the fleet-capable kv engine — the B5 row shape
(fillfactor 90) in one engine-owned schema, the deadpool pool with
per-connection prepared-statement discipline, the synchronous_commit
parity knob wired per-connection, ON CONFLICT DO NOTHING CAS, the
stable MVCC-snapshot list cursor, the batch-delete helper
(key = ANY($1), consumer wave 6), the read-only virgin-store split
- engine-postgres-fleet: the engine-state seam's full clause families
(ADR-012 §5's postgres row — every family yes): gc_pins + gc_window,
the joint tx ownership rule in the JointTx shape, pin_commit
atomicity, pin_renew/pin_check/arbitrate, the pg advisory lock as
the sweep lease's shipped provider; fleet activation stays wave 6
- store-postgres-construction: KvEngine::Postgres slots in, the
KvCursor arm, the dual-tier/kv-only constructors (DSN + opts +
threshold + window delay), the non-fleet posture recorded, the
pg-pure build verified
- suite-column-postgres: the first SKIP-posture column — the alkstore
pg-factory pattern reused (fresh schema per open, CASCADE teardown,
env-driven ALKBLOBS_PG_* settings), durable-schedule sweep rows,
acceptance green against the harness server (pglo-poc :15432,
verified live)
- review-wave-4: the engine-wave gate (engine-vs-contract conformance)
Verification: dependency graph validated (all ids resolve, no cycles,
topological order clean); docs-only change.
Refs: docs/plans/implementation.md §Wave 4