Repository navigation
fix(test): guard WAL recovery against the parent settlement barrier - #155009
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 5:37 PM ET / 21:37 UTC (Revision 4). ClawSweeper reviewWhat this changesAdds a regression that forces SQLite cleanup to overlap the parent’s settlement lock and verifies that cleanup subsequently recovers. Merge readiness✅ Ready for maintainer review Keep open: the production fix is on main, but this PR adds distinct regression coverage through the session-history cleanup entrypoint. No actionable patch defects were found. Priority: P2 Review scores
Verification
How this fits togetherSession-history cleanup enforces disk budgets using a SQLite worker. After reclaiming database pages, the worker must wait for the parent’s settlement lock to release before checkpointing the write-ahead log. flowchart TD
A[Session disk budget] --> B[History cleanup]
B --> C[SQLite worker reclaims pages]
C --> D[Parent settlement lock]
D --> E[Wait for lock release]
E --> F[Checkpoint and report recovery]
G[Test forces lock overlap] --> C
G --> D
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +144. Total +144 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain main’s production repair and add this entrypoint-level regression to guard the native settlement interleaving. Do we have a high-confidence way to reproduce the issue? Not applicable to a remaining current-main bug: production is already repaired. The supplied evidence reports a deterministic pre-fix failure and successful recovery with the forced native overlap. Is this the best way to solve the issue? Yes. Extending the existing budget test exercises the production worker wiring while retaining the original preservation and recovery assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5cdc987d2339. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
7b46740 to
0ca077c
Compare
Join the parent's native settlement barrier before post-commit page work so that the parent's own writer lock cannot create a fresh busy checkpoint. Preserve authority checks, abrupt-exit confirmation, and committed results. Force the real vacuum/settlement interleaving in the existing WAL-budget regression. It fails five times before the owner fix and passes five times after it, with the original recovery and preservation assertions intact. Related: #154302, #154543
0ca077c to
82cb951
Compare
…penclaw#155009) * fix(state): resume history cleanup after WAL recovery Join the parent's native settlement barrier before post-commit page work so that the parent's own writer lock cannot create a fresh busy checkpoint. Preserve authority checks, abrupt-exit confirmation, and committed results. Force the real vacuum/settlement interleaving in the existing WAL-budget regression. It fails five times before the owner fix and passes five times after it, with the original recovery and preservation assertions intact. Related: openclaw#154302, openclaw#154543 * test(state): rely on main WAL settlement repair
Related: #154302, #154543
What Problem This Solves
Adds deterministic regression coverage for session-history cleanup blocking its own post-vacuum WAL checkpoint. The production repair is already on main in bef4401; this PR now changes only the existing WAL-budget test (+144/-0).
Why This Change Was Made
The transaction case forces the real worker vacuum COMMIT to overlap the parent's native settlement transaction, then verifies that the forced barrier executed before checking recovery. A missing parent-release join reproduces the original checkpoint-incomplete failure. The iterator remains an ordinary control, and main's monotonic-clock and stale-observation checks remain intact.
The original deferral, retained-archive, physical-byte and recovery assertions are unchanged. No retry, sleep, polling assertion, timeout increase, or tolerance is added. Production is byte-identical to pinned origin/main d3b90d0.
Evidence
The forced regression previously failed 5/5 on the pre-fix owner. It now passes 5/5 on main with no production delta, including removal of the proposed authority-check additions. Each run passes both WAL-budget cases and records one verified native barrier with settlement observed inside it.
Main-only proof: Blacksmith Testbox
tbx_01m32wtbydvhx3qdxd5n50hbpe, run, Node 24.19.0, two Vitest workers. First-run wall includes shared compiler preparation.At tests-only head 82cb951, the six required suites pass 33/33 tests in 35.75s command wall: WAL budget (2), eviction lifecycle (6), reclamation commit (14), reclamation WAL (4), reclamation maintenance (6), mutation-worker runtime (1). WAL-budget file execution is 3.648s. Fresh validation lease:
tbx_01m32xavrk3xcasa7rxnrqwqn3, run.Full
node scripts/check-changed.mjs --base origin/main -- src/config/sessions/session-history-wal-budget.test.tspassed in 202.598s, including the affectedagents-sessionstype graph, all selected guards, dead-export scans, formatting and lint (0 warnings / 0 errors).The +144 regression patch is byte-for-byte unchanged from the reviewed candidate. The maintainer explicitly authorized reuse of that review for this tests-only result. Production LOC: 0. Tests: +144/-0.