Optimize comparisons for selected files - #1180
Open
EdwardBlair wants to merge 3 commits into
Open
Conversation
Avoid constructing a complete snapshot-tree comparison when undochange is given explicit paths. Compare only those paths, while preserving status, ignore-filter, and undo semantics. Perform selected comparisons inside snapperd so unprivileged clients do not need direct snapshot access. Add a D-Bus method for the bounded comparison and fall back to the existing full comparison when a new client is connected to an older daemon. Balance comparison and snapshot lifetimes on success and failure, make unmount cleanup non-throwing, reject paths outside the configured subvolume, and cover comparison and undo behavior with focused tests.
Author
|
Optional automated CLI/D-Bus regression coverage is available as a stacked draft PR against this PR’s head branch: EdwardBlair#2 It runs the real |
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
undochange,diff, orxadiffis given explicit pathssnapperd, with compatibility fallback for older daemonsFixes #251.
Testing
make checkin a disposable openSUSE Tumbleweed Podman containerselected-files.testcoverage for modified, created, deleted, type-changed, permission-changed, ignored, duplicate, and rejected paths, plus undo executiontestsuite-real: all 16 tests passed against a loopback Btrfs filesystem in a privileged disposable Podman container, including permissions, ownership, error handling, xattrs, and ACL restorationsnapperCLI, system D-Bus,snapperd, and a loopback Btrfs filesystem:/homeconfiguration with real snapshot history:snapper diff 1732..0 ~/.codex/config.toml: 36.355 s with Arch'ssnapper 0.13.1/libsnapper 8.0.0, 0.011 s with this branch (~3,300x faster)snapper undochange 1732..0 ~/.codex/config.toml: 21.235 s with Arch'ssnapper 0.13.1/libsnapper 8.0.0, 0.011 s with this branch (~1,930x faster)create:0 modify:1 delete:0, confirming that it performed a real restorationsnapperd, comparison, and filesystem workI use Arch btw 😉