Repository navigation
fix(update): shorten database rehearsal preparation - #157115
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: blocked before merge. Reviewed September 24, 2026, 4:04 AM ET / 08:04 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch changes update rehearsal to validate and publish one freshly acquired private SQLite image per database, and updates cleanup, tests, and update documentation. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. Current main still makes the redundant backup, and the proposed optimization is coherent. The required published-updater upgrade validation has not completed. Priority: P2 Review scores
Verification
How this fits togetherDuring an OpenClaw update, an isolated candidate worker copies live SQLite state for rehearsal. Verified copies and their schema versions feed candidate validation before activation. flowchart LR
A[Live SQLite state] --> B[Candidate snapshot worker]
B --> C[Private SQLite image]
C --> D[Integrity and rehearsal checks]
D --> E[Verified database copy]
E --> F[Candidate validation]
F --> G[Update decision]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +37, Tests +53, Docs +5. Total +95 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one verified private image per rehearsal database, then confirm that a published updater completes or safely recovers an upgrade using existing state. Do we have a high-confidence way to reproduce the issue? Yes. Current main visibly backs up an already-private rehearsal image; the focused worker test supplies a real-SQLite backup-count path, though this read-only review did not execute it. Is this the best way to solve the issue? Yes. The branch reuses the existing snapshot acquisition, validation, publication, and cleanup owners; its remaining qualification is the published-updater upgrade run. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b078de41c413. LabelsLabel changes: No label changes. Label 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 (1 earlier review cycle)
|
|
@clawsweeper re-review The published-driver proof is complete: https://github.com/openclaw/openclaw/actions/runs/35968993857 passed using published |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* perf(update): avoid duplicate rehearsal database backups * test(update): avoid shadowing snapshot source
What Problem This Solves
Database rehearsal preparation takes longer than necessary because it backs up each already-private SQLite snapshot a second time.
User Impact
Updates using the newer updater prepare copied database state faster with less disk work. Existing installed updaters keep their first-hop behavior. Source databases, recovery backups, migration checks, compaction, and verified publication retain their existing guarantees; no schema or configuration change is required.
Why This Change Was Made
The snapshot verifier now acquires and consumes its own fresh private image in the isolated updater process. It keeps WAL-aware acquisition and crash-residue handling, validates before transformation, and joins all consumer work before cleanup. Ordinary backup callers retain their existing acquisition path.
Evidence
Isolated Blacksmith Testbox benchmark: Linux x64, 4 vCPUs, Node 24.19.0; two 128 MiB synthetic databases with an independent WAL writer. After excluded warmups, three alternating baseline/candidate pairs ran the real inventory and snapshot workers. Source and output integrity, full payload hashes, and coherent generations passed in every trial. Baseline
3e3b870b2571; candidateabed6d816926.All three paired wall times improved; CPU was essentially flat (4.22 to 4.14 s). These are preparation-stage measurements, not whole-update latency. The Testbox lease was stopped after verification.
abed6d816926, including Linux and Windows coverage.pnpm test <file> --maxWorkers=1): snapshot owner 59.85 s local command wall; concurrent-writer boundary 22.15 s. Linux CI summed test durations were 1.425 s and 1.293 s respectively; Windows was 1.280 s and 2.973 s. Local command wall includes worker preparation.[email protected]upgraded existing synthetic operator state to candidate2026.9.6/0e60e06c258a, with tooling pinned to3e3b870b2571. The native outcome wassuccess; state/config survival, prepublish recovery-request assertions, Doctor checks, Gateway startup, health and readiness passed. The lane took 733 s. It used manual Gateway startup; forced rollback was not exercised. The final head differs only by a test-variable rename; production bytes are identical.