Repository navigation
fix(snapshot): make SQLite publication crash recoverable - #113367
Merged
vincentkoc merged 15 commits intoJul 24, 2026
Merged
Conversation
vincentkoc
force-pushed
the
fix/sqlite-snapshot-publication-durability-20260724
branch
from
July 24, 2026 16:22
f23cfcd to
d1ac5bc
Compare
vincentkoc
marked this pull request as ready for review
July 24, 2026 17:30
Member
Author
|
Land-ready proof for exact head
Known remaining matrix work is tracked in #113306: WSL2, ARM64, broader filesystems/containers, high-I/O contention, and real power-loss replay. |
vincentkoc
deleted the
fix/sqlite-snapshot-publication-durability-20260724
branch
July 24, 2026 17:56
Member
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 25, 2026
…3367) * fix(sqlite): pin directory durability checks * fix(snapshot): make publication crash recoverable * fix(snapshot): revalidate committed publication * fix(sqlite): pin durable directory ancestry * test(sqlite): target directory sync fault * fix(sqlite): pin every durability edge * test(sqlite): target pinned sync failures * fix(snapshot): reject markerless partial state * fix(sqlite): harden durable directory opens * test(snapshot): accept hardened redirect rejection * test(sqlite): accept optional open flags * fix(sqlite): repair pinned directory permissions * fix(sqlite): bind publication and trusted repair * fix(snapshot): preserve safe repository mode repair * fix(sqlite): keep sync outcome internal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #113306
What Problem This Solves
Fixes an issue where SQLite snapshot creation and fresh restore could report success after newly created parent links or final publication metadata had not been durably synchronized. A crash at those boundaries could leave missing, partial, or ambiguously committed state.
Why This Change Was Made
The change adds an identity-pinned directory durability primitive that is strict on POSIX filesystems and explicitly classifies unsupported Windows directory flushing. POSIX directory opens reject symlinks and FIFOs without blocking. Existing private repositories are repaired only after owner, ancestor, and ACL validation, then the durability pin is bound to the exact repaired directory identity.
Snapshot repositories now durably link newly created parent chains, fsync the
.pendingmarker before publishing payloads, persist the repository entry before payload publication, and use pending removal plus a directory sync as the commit point. Shared SQLite publication pins the destination directory before staging or linking and uses that receipt for every strict sync. Fresh restore verifies the exact durably created parent identity and reports final staging-cleanup sync failures.User Impact
Operators get stronger crash consistency for snapshot creation and fresh restore. On supported filesystems, success now means the relevant parent and publication metadata syncs completed. Empty or
.pendingdirectories remain recoverable interrupted state; markerless artifact-only, manifest-only, or unknown contents fail closed instead of being silently hidden.Evidence
8adfdb2c2a02ee669ebb49e95ee68706f1062158on Blacksmith Testboxtbx_01kyadf1xhgz410c460skrffdf(run https://github.com/openclaw/openclaw/actions/runs/30107403342): 94 focused assertions passed and 5 platform assertions skipped across repository create/list/verify/restore, strict directory durability, and shared SQLite publication.pnpm check:changedpassed on the same Testbox.pnpm test:windows:cishards, including deep-path snapshot, unsafe-index, and SQLite publication coverage. WSL2 was unavailable and is not claimed by this PR.000,200,300, and777, POSIX unsupported-code propagation, Windows unsupported classification, pending-file sync failure, exact publication ordering, markerless partial state, post-commit mutation, and final restore cleanup sync failure.git diff --checkpassed.