68 lines
2.6 KiB
Markdown
68 lines
2.6 KiB
Markdown
---
|
|
id: pg-fix-scheduler-tick-seam
|
|
name: "pg scheduler — transient-fault tick seam: retry/exhaustion arms tested (review 003 Finding 1)"
|
|
status: pending
|
|
depends_on: []
|
|
scope: narrow
|
|
risk: low
|
|
impact: component
|
|
level: implementation
|
|
tags: [wave-6, postgres-engine, scheduler, test-hardening]
|
|
---
|
|
|
|
## Description
|
|
|
|
Review 003 Finding 1 (MEDIUM — `docs/reviews/003-wave-5-general-review.md`):
|
|
the pg scheduler's transient-error retry loop
|
|
(`alkstore-postgres/src/scheduler.rs:680-704`, `tick_with_retries`)
|
|
has never executed under any test — `pg-fix-scheduler-resilience`
|
|
pinned its *constants* (`the_tick_retry_policy_is_pinned`) but the
|
|
loop that uses them (retry, backoff sleeps, exhaustion error, the
|
|
`eprintln` diagnostic — lcov 171-184, 237-260) is dead code under
|
|
test, with no fault seam anywhere in the pg scheduler for `tick_once`.
|
|
This is the last uncovered hardening arm from the wave-4 fix batch,
|
|
and the exact class that produced review 002's live bugs.
|
|
|
|
Fix shape (the review's recommendation): a `cfg(test)` transient-
|
|
fault seam on the pg tick path, following the `sqlite-commit-error-arm
|
|
` precedent — a one-shot armed flag feeding a fabricated
|
|
transient error into the *real* retry loop (never a replica):
|
|
|
|
- (a) one retried tick then success: the seam faults once, the next
|
|
`tick_once` succeeds, the job processes — the retry + backoff-sleep
|
|
arms execute for real;
|
|
- (b) exhaustion: the seam faults the max retry count, the loop
|
|
exhausts to the typed error shape and the `eprintln` diagnostic
|
|
fires, the runner survives (the resilience property the fix
|
|
promised).
|
|
|
|
Cross-test safety is per-store scoping (the commit-fault seam's
|
|
pattern); no production-path changes — the seam is cfg-gated, born
|
|
disarmed, consumed-on-use.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] The seam lands cfg(test)-gated; the real `tick_with_retries`
|
|
executes under test (no loop replication)
|
|
- [ ] Arms (a) and (b) pinned as above; the runner survives
|
|
exhaustion
|
|
- [ ] `cargo test -p alkstore-postgres` green against the harness
|
|
server; skips clean server-less
|
|
- [ ] Clippy `-D warnings`, fmt clean; workspace gates green
|
|
|
|
## References
|
|
|
|
- docs/reviews/003-wave-5-general-review.md §Finding 1 (sites, lcov
|
|
inventory, recommendation)
|
|
- docs/architecture/decisions/024-mem-engine.md (the wave-6 window
|
|
this rider rides — the plan's wave-6 section, "Riding the window")
|
|
- tasks/sqlite-commit-error-arm.md (the seam pattern of record)
|
|
- tasks/pg-fix-scheduler-resilience.md (the constants the loop uses)
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |