-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Btrfs snapshotter without snapper #2220
Btrfs snapshotter without snapper #2220
Conversation
I consider this PR ready to be reviewed despite being in draft. Probably minor changes could be applied on top of the current logic to make public subvolumeBackend interface and its implementations in order to include specific unit tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I found it confusing that the snapper backend is using the (plain) btrfs one, but I agree that this should be addressed on the snapper side instead with the other issue you already linked.
Nice improvement!
Yes I agree, so far this is the simplest idea that came to my mind to not duplicate code. Opened to other ideas too 😉 |
Signed-off-by: David Cassany <[email protected]>
This commit adds a backend interface in btrfs snapshotter. The interface essentially wraps snapper and btrfs utilities. The idea is make a pure btrfs implementation of the interface and also a snapper based implementation. The functions that snapper can't provide are simply managed by the btrfs implementation. Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
This commit implements the btrfs backend for the btrfs snapshotter and moves all the logic of specific btrfs client calls there. The backend interface is also refined for that purpose. Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
Signed-off-by: David Cassany <[email protected]>
bc86410
to
a31e34a
Compare
Signed-off-by: David Cassany <[email protected]>
This pull requests provides a new
subvolumebackend
interface to handle btrfs subvolumes and snapshots. The motivation is to not make snapper strict requirement of the btrfs snapshotter to better suite distributions where snapper is not that much adopted.In any case (even if snapper is not in use) the snapshotter is based and built around common snapper conventions, this is easier from a maintenance perspective and allows to eventually consider switching to snapper at a later point in time.
This PR adds a new config parameter
snapper
for the btrfs snapshotter:If snapper set to
true
(this is the default value) the snapshotter will attempt to use snapper, otherwise it will relay entirely onbtrfs
utility calls.Snapper can't perform alone all the uses cases that the Elemental Snapshotter interface requires (specially corner cases related to first snapshot), for those cases the
snapperBackend
implementation makes use of thebtrfsBacked
implementation, hopefully this can be improved in up comming snapper releases (openSUSE/snapper#944).This PR includes a couple minor behavior changes (on the snapperBackend) that are actually reflected in unit tests: