Repository navigation
v3.0.0 fix: bound prepared template and balance blob cleanup - #378
Conversation
Sweep indexed blob pages with the existing settlement then ordering locks, retain every remaining reference, and carry one deadline through PostgreSQL statements and commit. Exercise repair, candidate retention, bounded progress, and cancellation against disposable PostgreSQL. Refs #273
|
@cursor review |
Reuse the established fatal-state and legacy-writer fence before deleting jobs or blobs. Verify that a halted cluster preserves every row and cursor position and that the same page becomes collectible after recovery.
|
@cursor review |
Use a stable statement cutoff for the expiry index and a bounded array initplan for deletion by primary key. Preserve the outer expiry recheck and verify that a renewal committed during the DELETE row-lock wait retains the prepared row and its blobs.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 72347fd. Configure here.
|
Review close-out resumed at 65f0377. Independent Fable adversarial and thermo verification are actively checking the final cleanup fix: expired-job deletion outside the share-ordering locks, a separate blob-cleanup deadline, reference retention, and rollback/cursor behavior. CI is green; final verification is pending, not claimed complete. |
Final coordinator review disposition — 65f0377Both independent final lanes returned no correctness blocker. The original share-lock/expiry regression is fixed and independently verified; the thermo verifier additionally ran 51 PostgreSQL/server-pruner tests successfully on PostgreSQL 16.15. All 19 active CI checks pass and there are no unresolved inline threads. Final non-mandatory review notes were evaluated rather than silently counted as fixes:
No additional code fix is requested by this close-out. Merge-ready at 65f0377. This is only the blob-retention slice; #273 remains open for compact runtime activation and end-to-end qualification. |
Summary
Collect orphaned prepared-template and shared-balance blobs from the existing job pruner, including ticks that expire no jobs.
Job expiry and blob cleanup are separate phases. Expiry deletes at most 4,096 rows directly on the pool, outside the settlement/ordering advisory locks, using the existing database statement budget. After expiry succeeds, blob cleanup starts a fresh five-second deadline, acquires settlement then ordering locks, checks the writable fence, and inspects at most 256 keys per blob table.
Every remaining job and candidate reference is retained, regardless of candidate claim-lease expiry. Cursors advance only after successful blob commit. Blob failure rolls back blob changes, not already committed job expiry. Transaction-local statement timeouts preserve stricter configured settings and bound cleanup after cancellation.
Final qualification
Reviewed head:
65f0377aa475bb1844d656aa99668dc5ce14df07.72347fd; it is not represented as a fresh review of this head.A disposable 50,000-key planner fixture confirms bounded indexed expiry/page/reference probes. This is synthetic planner evidence, not a production latency or WAL guarantee.
Explicit boundaries
Expiry failure skips that tick's blob sweep; phases are sequential, not independently scheduled. A tick can consume the existing expiry budget plus the blob budget, with no overlapping batches. Expiry still runs while a halted cluster refuses blob cleanup, preserving existing expiry behavior.
No new post-expiry grace is selected. Compact runtime activation and full refresh/resume qualification remain separate work.
Refs #273