Repository navigation
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This branch has not been deployed
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.
Summary
A tree that v0.1.7 staged cannot be undone or purged by main. v0.1.7 wrote its WAL at v11, before held-tree sidecars, so the v3 content manifest of each tree it staged has no sidecar behind it. Since #90, recovery sends every v3 manifest to the streamed verifier, which reads the published sidecar. A v3 staging without one fails as
UndoManifestChangedand is recordedRecoveryRequired, as if its baseline had been lost. From then on every clean, undo and purge refuses to run until the store is recovered by hand. A clean purges trash entries seven days old through the same admission, so an upgraded account reaches this without asking for it.Recovery now streams a v3 manifest only when the WAL replayed the staging at v12 or later, the rule the WAL already applies when it requires a sidecar before
TreeSealed. An earlier staging is verified by the resident walk it was sealed against. This applies at all three places that verify a staged tree: verified undo, purge admission, and verification of a staging found after a restart. A v12 or later staging whose sidecar is missing or corrupt is refused as before.Restored modes. The resident walk checked each directory's mode against the sealed one only before undo restored it. Once the modes were restored, it replaced every directory's mode with the sealed one and compared the digest, so a directory whose mode changed after the restore still passed and was renamed back. It now requires each directory to be at the mode undo restored before it replaces it, as the streamed path does. Stagings with v1 and v2 manifests use the same walk and get the same check.
How it was found. Preparing the next release, I staged with the v0.1.7 release binary and undid with main in an ext4 chroot on Ubuntu 24.04, x86_64. The undo failed on a plain pip cache, and bisecting 6d6ceda..d1db13a with the same check gave bc8138a (#90) as the first bad commit.
Not changed. v0.1.7 still cannot open a WAL that a later version has written to; it reports
unsupported legacy WAL version 13. Moving back is not supported, and this does not change that.Validation
Passed locally on this branch:
The suite is at 1826 passed / 0 failed / 1 ignored.
undo_before_sidecars,purge_before_sidecars,verify_before_sidecars: a staging is rewritten as v0.1.7 would have left it, with every frame at v11, the manifest record without the sidecar commitment and the sidecar removed. It is then undone, purged, and verified after a restart. On main the first two fail with the errors above and the third does not verify.drift_before_sidecars: a changed tree from before sidecars is refused, and the staging staysVerifiedCommittedand undoable instead of being recorded as a lost baseline.drift_after_restore: once undo has restored a directory to 0o770, it is changed to 0o700 before the tree is verified. The undo stops atUndoModesRestoredwithout renaming the tree back, for a staging from before sidecars and for one with a sidecar. Before the second commit, the staging from before sidecars was renamed back.sidecar_era_boundary: a v11 staging binds no sidecar, while v12 and v13 stagings do. main wrote v12 from feat(core): bind held-tree sidecars to WAL recovery #87 to perf(core): record a purge's progress once, at its end #219, so a store from those builds has sidecars to check.Thirteen mutations, all caught on the final code. Nine are on the dispatch: binding a sidecar always or never, moving the boundary to 11 or 13, reverting each of the four call sites to the schema check alone, and dropping the version from the streaming check. Never binding a sidecar also fails ten existing tests of the streamed path, among them the ones that refuse a corrupt sidecar. Four are on the restored-mode check: always expecting the sealed mode, always expecting the original one, swapping the two, and leaving the mode out of the comparison.
Across versions, in the same chroot, with the v0.1.7 release (
x86_64-unknown-linux-musl) staging and a static build of this branch's head undoing or purging. Each case ran in a new account, and "identical" compares every path's type, mode, link count, size, symlink target, content hash anduser.*xattrs before and after.undotrash purgetarget, then undoes pipundoundoSafety
TreeSealed.RecoveryRequired.