Repository navigation
fix(update): finish 2026.9.2 updates when the Gateway publishes the deferred schema mid-update - #192140
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. What this changesThis PR lets existing-schema writers adopt a peer's completed schema publication through the shared admission owner. Example: An updater retains schema version 15 while the Gateway publishes version 39 before plugin-cohort settlement.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a concrete update failure still present on current main, and source review found no introduced correctness defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared-state admission layer receives SQLite connections and schema metadata, validates storage compatibility, and supplies admitted facts to maintenance operations and transactional writers. flowchart TD
A[Gateway publication watcher] --> B[SQLite header and metadata]
C[Updater plugin settlement] --> D[Existing schema writer]
D --> E[Shared admission owner]
B --> E
E --> F[Transactional lease operation]
Technical reviewBest possible solution: Keep peer-publication adoption in the existing admission owner and retain the transaction-local ownership, integrity, and schema checks. Do we have a high-confidence way to reproduce the issue? Source confirms that admission occurs before BEGIN and metadata validation afterward, allowing a peer publication between them; the PR reports an exact base-red regression, but this read-only review executed no reproduction. Is this the best way to solve the issue? The patch is a focused repair of the existing invariant: accept completed publication only when the header and metadata both equal the supported current version, while preserving other refusals. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0d2071eba04f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +28, Tests +49. Total +77 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 3, 2026, 12:59 PM ET / 17:59 UTC. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…eferred schema mid-update (openclaw#192140) * fix(update): keep plugin leases working when the Gateway publishes a deferred schema * test(state): prove the peer publication race through the real lease write
Share the current-header and metadata publication check between retained maintenance connections and existing-schema lease writes. Keep mismatched markers refused and preserve the existing ownership checks. Co-authored-by: RomneyDa <[email protected]>
Related: #191357
What Problem This Solves
Fixes: updating from 2026.9.2 can end with "Update has unfinished recovery" and leave that update's recovery pending, when the restarted Gateway publishes the deferred state schema version at the same moment the updater settles its plugin cohort.
User Impact
User impact: an update that runs while a 2026.9.2 run's five-minute schema grace window ends now completes normally. Before this change, the plugin lifecycle lease failed with
Existing-state schema metadata is inconsistent.. The run then reportedupdate-recovery-pendingwithruntime-verification-failed, andopenclaw update repairwas the only way forward.Why This Change Was Made
2026.9.2 updaters defer publishing the shared-state
user_version. When the five-minute grace expires, the restarted Gateway's update-run watcher publishes the header andschema_metain one transaction. An existing-schema writer, here the plugin lifecycle lease taken bysettleUpdatePluginCohort, admits its schema facts beforeBEGIN. It then waits on the publisher's write lock, and inside its own transaction it reads the freshschema_meta. It compared that value with the version admitted beforeBEGIN(15 against the current version) and refused. Every later step reported only the follow-on own-runUpdateRecoveryRequiredError.#191357 added the right rule for the maintenance assertion: adopt a peer's publication only when the header and the metadata both read current inside this connection. This PR moves that rule into the admission owner (
openclaw-state-db-admission.ts), next topublishStateSchemaVersionAdmission. The maintenance assertion and the existing-schema writer now share it, and the writer publishes the adopted version to its subset admission. A genuinely inconsistent database still refuses.Evidence
src/state/openclaw-state-db-peer-publication.test.ts, "admits a peer process publication for existing-schema writes". A real child process holdsBEGIN IMMEDIATEwhile it publishes the header andschema_meta. Meanwhile the parent runs an existing-schema write with the lease schema subset. Red on base with the exact production message,Existing-state schema metadata is inconsistent.; green with the fix. The peer-publication, existing-write and lease-maintenance suites all pass, 34 tests.update-first-hop-compat-2026.9.2Docker lane:OpenClawStateLeaseError: failed to acquire plugin lifecycle lease core:plugin-lifecycle/global: store unavailable (storage-error). It was raised fromsettleUpdatePluginCohort→commitVerifiedUpdatePluginCohort→reportResult, with causeExisting-state schema metadata is inconsistent.. Unwind admission then raised the own-runhas unfinished recoveryrefusal, which is what CI shows. CI hit the same signature on main d615435 in run 41656977990, which failed 1 of 3.update-first-hop-compat-2026.9.2Docker lane, red/green on one Crabbox AWS box (c7a.48xlarge), 3 concurrent runs per batch, packages built from the same base 01838fc.has unfinished recovery.positive-second~395 s andpositive-unsupported-admission~390 s.oxlintcore shard andtsgo:corepass.$autoreviewis scoped-clean. An independentcodex execreview returned NO FINDINGS.