pg queue/tx/notify dedupe + doc truth-telling: job_from_row has one owner (queue.rs, tx.rs imports it) and get_job_tx reuses live_columns()/dead_columns() instead of inlining the 18-column lists — the contract-pinned Job shape now has exactly one decode owner (ADR-012 §2); sweep_expired's doc states the moved + retention-deleted sum in the in_tx multi-statement frame (the sum the SQLite twin returns — the doc was the only liar); notify.rs's closed-store listen error routes through the shared database_error helper; bridge_capacity() is a const with its rationale doc carried. No behavior change — identical SQL strings, error shapes, and capacity. (task pg-fix-dedupe-cleanup, review 002 minor notes + Finding 6 queue bullet)
This commit is contained in:
1 parent
12d0497b1c
commit
40625090f6
4 files changed
+61
-77
No files matched your search
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: pg-fix-dedupe-cleanup
|
||||
name: Decode dedupe + small cleanups in queue/tx/notify (review 002 minor notes)
|
||||
status: pending
|
||||
status: completed
|
||||
depends_on: [pg-fix-tx-wake]
|
||||
scope: narrow
|
||||
risk: low
|
||||
@@ -76,8 +76,41 @@ landing after avoids touching the same file regions blind.
|
||||
|
||||
## Notes
|
||||
|
||||
> To be filled by implementation agent
|
||||
- The dedupe landed as the task pinned: `job_from_row` is now owned by
|
||||
`queue.rs` (`pub(crate)`), `tx.rs` imports it; queue.rs's
|
||||
`live_columns()`/`dead_columns()` went `pub(crate)` so `get_job_tx`
|
||||
reuses them (the `format!`-bound `{dead}`/`{live}` select strings are
|
||||
byte-identical to the inlined lists, so zero SQL change). Tx-side
|
||||
imports ride the existing `crate::queue` module edge — fine
|
||||
crate-internally (queue.rs already imports tx.rs's
|
||||
`encode_payload_bytes`/`enqueue_row`; Rust module cycles are legal
|
||||
within a crate).
|
||||
- Doc truth-telling choices: queue.rs's `job_from_row` doc now states
|
||||
the one owner explicitly ("the tx reads (`crate::tx`) ... import it");
|
||||
tx.rs's trailing decode-owner comment now names both decode owners
|
||||
(stream decode in `stream.rs`, job decode in `queue.rs`) under
|
||||
ADR-012 §2; the removed tx.rs duplicate carried `JobState`'s only
|
||||
remaining use, so that import was dropped. queue.rs's `sweep_expired`
|
||||
module-doc bullet now states the moved + retention-deleted sum and
|
||||
the `in_tx` multi-statement frame (matching the SQLite twin's
|
||||
semantics — the code already pinned the sum).
|
||||
- `bridge_capacity()` → `const BRIDGE_CAPACITY` with the rationale doc
|
||||
comment carried; the closed-store error in `listen` now routes
|
||||
through `database_error` (it was the only inline duplicate;
|
||||
import already present).
|
||||
- No behavior change anywhere: the select SQL strings, error shapes,
|
||||
and the bridge capacity value are identical.
|
||||
|
||||
## Summary
|
||||
|
||||
> To be filled on completion
|
||||
Deduped the pg engine's job-row decode and cleaned the wave-4 minor
|
||||
notes (review 002): `job_from_row` has one owner (`queue.rs`), `get_job_tx`
|
||||
reuses `live_columns()`/`dead_columns()` instead of inlining the
|
||||
18-column lists, `sweep_expired`'s doc states the moved +
|
||||
retention-deleted sum in the `in_tx` frame (the sum the SQLite twin
|
||||
returns), `notify.rs`'s closed-store error routes through
|
||||
`database_error`, and `bridge_capacity` is a `const`. Verified: pg
|
||||
suite 140/140 green against the harness server (`pglo-poc` :15432)
|
||||
and 140/140 server-less, unchanged assertions; workspace
|
||||
`cargo build` / `cargo clippy --all-targets -- -D warnings` /
|
||||
`cargo fmt --check` / `cargo test --workspace` all clean.
|
||||
Reference in new issue
Block a user