pg: run_schedules' failed-renewal arm classifies as Database, never LeadershipLost (review 004 item 9's pg twin) — a lost lease (Ok(false)) keeps the respawn arm unchanged; a failed renewal (closed store / storage failure) propagates its opaque classification, matching the sqlite task's 2026-10-11 classification landed engine-neutral in ADR-009 §1 / core-contract §Errors (cited, not re-decided); module doc aligned; two tests pin both arms on the harness server (the sqlite twin's pin shapes); task -> completed
This commit is contained in:
1 parent
c03c798e34
commit
608104ab13
3 files changed
+249
-10
No files matched your search
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: pg-fix-scheduler-error-classification
|
||||
name: Classify run_schedules' renew-failure arms on pg (the sqlite twin, review 004 item 9)
|
||||
status: pending
|
||||
status: completed
|
||||
depends_on: []
|
||||
scope: narrow
|
||||
risk: low
|
||||
@@ -77,8 +77,56 @@ a mid-run close exits with the closed `Database` classification, never
|
||||
|
||||
## Notes
|
||||
|
||||
> To be filled by implementation agent
|
||||
- **No discrepancy with the decisions of record**: the sqlite task's
|
||||
arm set implemented verbatim — `Ok(false)` keeps
|
||||
`Err(LeadershipLost)` return-before-tick (the respawn arm),
|
||||
`Err(e)` propagates unchanged (no new variant, no re-deciding; the
|
||||
`Closed`-stays-wake-receiver posture untouched).
|
||||
- **Harness server (was the recorded blocker)**: the `pglo-poc`
|
||||
container was up on :15432; the standard env
|
||||
(`ALKSTORE_PG_HOST/PORT/USER/PASSWORD/DB=…/15432/postgres/poc/blobs`)
|
||||
ran the whole pg suite live — nothing was held back to the
|
||||
server-less skip posture.
|
||||
- **Engine note (how the closed arm arrives)**: pg's closed-store
|
||||
classification is *proactive* — `PgLockHandle::renew` checks the
|
||||
store's shared `closed` flag before any SQL (locked.rs closed-sign
|
||||
first, the sqlite twin's shape; pinned by pg lock_tests) — so the
|
||||
test drives it through the fixture store's own `EngineCtx`
|
||||
(`run_schedules` runs on `fx.store.engine_ctx()`, sharing the
|
||||
closed flag and pool; `close()` then flips the runner's flag), not
|
||||
through a second store instance the way the sqlite pin's
|
||||
same-file DB works. The genuine-loss arm drives through the
|
||||
runner-store pattern (second `open_store` on the same dsn/schema)
|
||||
with an admin-client `DELETE` of the lock row — the twin's rogue
|
||||
deletion shape.
|
||||
- **Doc alignment**: the pg scheduler's module doc got the arm-set
|
||||
sentence (the pg-specific text this criterion calls out) — the
|
||||
SQLite twin's wording (`Ok(false)` = the loss / `Err(e)` =
|
||||
opaque-propagate, review 004 item 9). ADR-009 §1 and
|
||||
core-contract.md §Errors verified engine-neutral as landed
|
||||
(2026-10-11, dated annotation; no engine names) — cited, not
|
||||
touched; engine-postgres.md's scheduler row doesn't describe the
|
||||
renew arm, so it needs nothing.
|
||||
|
||||
## Summary
|
||||
|
||||
> To be filled on completion
|
||||
The pg leader loop's top-of-iteration renew no longer flattens a
|
||||
failed renewal into `LeadershipLost` (`scheduler.rs` — the
|
||||
`unwrap_or(false)` the sqlite task recorded): `Ok(false)` keeps the
|
||||
`Err(LeadershipLost)` respawn arm unchanged, and a failed renewal
|
||||
propagates its opaque `Database` classification unchanged (the
|
||||
closed-store arm arrives pre-classified — the engine-wide "the store
|
||||
is closed" source, the proactive closed-sign posture) — respawning a
|
||||
leader against a dead store is no longer the pg outcome either; the
|
||||
sqlite/pg twins now classify identically. Two acceptance tests pin
|
||||
the arms against the harness server, modeled on the sqlite pair:
|
||||
`closed_store_run_reports_the_closed_classification_not_leadership_
|
||||
lost` (the runner runs on the fixture's own EngineCtx and the store
|
||||
closes mid-run — the exit is the closed `Database` classification,
|
||||
never `LeadershipLost`) and `mid_run_lease_loss_still_returns_
|
||||
leadership_lost` (a deleted lease row mid-run still returns the
|
||||
loss, the respawn arm unchanged). Verified: full
|
||||
`cargo test -p alkstore-postgres` green on the live harness server
|
||||
(133 lib + 25 contract suite + 9 schema tests), workspace gates green
|
||||
server-less, clippy `-D warnings` clean, `cargo fmt --check` clean,
|
||||
doc gate clean, fuzz corpus replay (6/6) green.
|
||||
Reference in new issue
Block a user