Repository navigation
fix(update): avoid rehearsal failures while databases are active - #149449
Conversation
Use the existing async backup path only for disposable rehearsal copies. Preserve synchronous inspection, bounded worker output, and parent-owned scratch when worker or monitor termination is uncertain. Cover concurrent WAL writers, snapshot integrity, cancellation, deadlines, low-space refusal, and stdout/stderr overflow through the worker boundary.
|
🦞👀 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: blocked before merge. Reviewed September 18, 2026, 7:13 PM ET / 23:13 UTC (Revision 13). ClawSweeper reviewWhat this changesThe PR uses SQLite online backup for disposable update rehearsal copies, preserves scratch when worker cleanup is uncertain, and adds concurrent-write and failure-path coverage. Merge readiness⛔ Blocked before merge - 3 items remain The repair remains necessary on current main, and no introduced blocking defect was found. This actively maintained PR still has an explicit native Windows qualification and upgrade-evidence reconciliation gate. Priority: P2 Review scores
Verification
How this fits togetherUpdate rehearsal copies existing databases into private scratch so candidate diagnostics can run before activation. The snapshot owner coordinates capacity checks, subprocess completion, and cleanup before handing the copies to candidate validation. flowchart TD
A[Existing databases and active writers] --> B[Rehearsal inventory]
B --> C[Capacity checks]
C --> D[SQLite online backup worker]
D --> E{Worker cleanup confirmed?}
E -->|Success| F[Private copies for candidate validation]
E -->|Uncertain| G[Refuse rehearsal and retain scratch]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +33, Tests +568, Config 0. Total +601 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep rehearsal acquisition with the existing SQLite backup owner, preserve inspection and rollback contracts, and establish native and published-driver compatibility for the landing candidate. Do we have a high-confidence way to reproduce the issue? Yes, from source: continuous WAL writes can invalidate every synchronous copy attempt used by current main. The PR supplies a concrete real-worker regression path and reports before/after results; this review did not execute it. Is this the best way to solve the issue? Yes. Reusing the existing online-backup owner only for disposable rehearsal copies is a narrow repair that preserves the separate schema-inspection contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2d1973e31d3a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
Align the canary snapshot mock with the bounded UTF-8 runner. Delegate real progress probes and non-canary children; exclude snapshot-worker results from progress-byte parsing. Preserve timing, cancellation, byte-limit and capacity assertions. Include the reviewed managed-parent lifecycle assertion grouping that resolves the shared max-lines prerequisite. These test corrections address failures in the preceding hosted run. Source review and focused static checks passed; behavioral and type qualification must come from the corrected exact-head hosted run. First-hop and native LAND gates remain open.
|
Commandeering this PR at Josh's request. This is a mutiny. 🏴☠️ I'll work through the outstanding ClawSweeper findings, verify the fixes, and push them to this branch. No merge as part of this takeover; the declared native and published-updater qualification gates remain explicit. Repair follow-upPushed
Validation: 85 focused tests passed (41 rehearsal/backup tests and 44 process-control contract tests); repository changed checks passed, including services test typecheck, lint, and dead-export scans; fresh independent P0–P2 review of this repair is scoped-clean. Reproduced the original Windows resolver rejection and verified repaired argv admission through that same resolver on Linux. This is contract evidence, not native Windows execution. Production LOC delta: 0. Two test files: +19/-16. Native-platform qualification and published-driver × candidate first-hop proof remain separate, unverified merge gates. No merge performed. Follow-up |
|
Resolved the two failures from CI run 35154396910 by merging the existing upstream fixes into this branch, pushed as
No additional source edits or speculative test changes. Hosted CI must qualify the new head; native-platform and published-updater first-hop proof gaps remain separate. PR not merged. |
Use append-only committed progress records to avoid the observed Windows rename race while preserving concurrent WAL acquisition assertions. Include the exact test-only CI prerequisites from #152099 (d339607) and three duplicate declaration removals from #152028 (3fceb86). Co-authored-by: Peter Steinberger <[email protected]>
Integrate the exact CI base 87e2cfb and preserve its canonical progress-probe helper without duplicate bindings. Align the real cancellation regression with confirmed cooperative settlement from #152107, retaining uncertainty preservation controls. 115 rehearsal tests pass; the complete integrated PR delta is independently reviewed through P2.
|
Merged via squash.
|
…nclaw#149449) * fix(update): snapshot rehearsal SQLite through online backup Use the existing async backup path only for disposable rehearsal copies. Preserve synchronous inspection, bounded worker output, and parent-owned scratch when worker or monitor termination is uncertain. Cover concurrent WAL writers, snapshot integrity, cancellation, deadlines, low-space refusal, and stdout/stderr overflow through the worker boundary. * test(update): align rehearsal mocks with bounded snapshot runner Align the canary snapshot mock with the bounded UTF-8 runner. Delegate real progress probes and non-canary children; exclude snapshot-worker results from progress-byte parsing. Preserve timing, cancellation, byte-limit and capacity assertions. Include the reviewed managed-parent lifecycle assertion grouping that resolves the shared max-lines prerequisite. These test corrections address failures in the preceding hosted run. Source review and focused static checks passed; behavioral and type qualification must come from the corrected exact-head hosted run. First-hop and native LAND gates remain open. * test(update): make rehearsal worker fixtures portable * test(update): scope rehearsal fixtures to worker entrypoint * test(update): compare equivalent Windows scratch paths * test(update): stabilize Windows rehearsal qualification Use append-only committed progress records to avoid the observed Windows rename race while preserving concurrent WAL acquisition assertions. Include the exact test-only CI prerequisites from openclaw#152099 (c857531) and three duplicate declaration removals from openclaw#152028 (75ac5ef). Co-authored-by: Peter Steinberger <[email protected]> --------- Co-authored-by: jalehman <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What problem this solves
Update rehearsal could fail to inventory or copy databases while another process kept committing SQLite WAL transactions. Rehearsal now uses the existing SQLite online-backup owner to acquire consistent disposable copies. Schema inspection keeps its existing synchronous, non-attaching path.
Cancellation, deadlines, disk-space and output limits remain enforced. Scratch is retained when worker or monitor settlement cannot be confirmed.
Related: #144005, #145169, #149350. This is the acquisition repair, not completion of the broader atomic-update rollout.
Verified landing evidence
Reviewed head:
a9ad9f76e71292e5a41dabfb10f71a4562095aeb. Complete ten-file delta independently reviewed through P2 with no actionable findings; all reviewed hashes and the published diff match.[email protected]upgraded thelegacy-operator-statescenario withauto-auth; passed in 212 seconds. Tested CI candidatec4f071e922295dbf76d2207a675e5a60d7fb781dmerges this exact head intoaa6d12cc10412e7059bd0df7910bea18036fe5f2; both changed production blobs match the reviewed head.Qualification scope and remaining separate work
The extra Windows workflow failed an unchanged Scheduled Task owner-identity path and an unchanged Control UI publication test after the rehearsal tests passed. Those failures are retained, not counted as success. #151157 owns the Scheduled Task repair; its whole lifecycle/installer qualification is not a source dependency of this rehearsal-only change. The native task was removed and cleanup reported no errors.
Earlier published
2026.9.4first-hop results remain valid only for their recorded older source combination; they are not exact-head proof. The current candidate-bound published-driver cell is the successful2026.9.3job above. This candidate change cannot retroactively patch an already installed updater; broader bootstrap delivery, capture retirement, live readiness and rollout remain separately owned.The previous pending-hosted-check landing hold is superseded by the verified results above. No source change, test waiver, runtime restart, or full-program acceptance claim was needed to reconcile it.