Do not snapshot child filesystem if it has a more specific config#105
Open
ruipin wants to merge 2 commits into
Open
Do not snapshot child filesystem if it has a more specific config#105ruipin wants to merge 2 commits into
ruipin wants to merge 2 commits into
Conversation
Author
|
Removed some printing/debug code that I had accidentally left in the commit. The latest commit should be clean. |
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.
Issue
Currently, pyznap triggers a snapshot for all children datasets based on the parent config. However, the way this is implemented can cause multiple issues when we want specific children datasets to have different snapshot settings.
This PR fixes this issue, by forgoing snapshots of children datasets when there is a more specific config targeting them.
Example 1: Disabling snapshots for specific children
Imagine we have a ZFS file system named
rpoolwith many children which we want to snapshot, but one calledrpool/swapwe don't want to snapshot at all.Per the documentation, we would expect the following to work:
However, this does not work. Upon seeing the
rpoolconfig, pyznap will trigger a snapshot of all child filesystems regardless of whether they have a more specific config. Because therpoolconfig hassnap = yes, this means thatrpool/swapwould be snapshotted.With this PR, this case works as expected, and
rpool/swapis not snapshotted.Example 2: Turning off specific types of snapshots for specific children
Image we have a ZFS filesystem named
rpoolwith many children for which we want to keep 3 monthly snapshots.However, for one of the children
rpool/some-dataset, we do not wish to take monthly snapshots at all.Per the documentation, we would expect the following to work:
However, this does not work. Upon seeing the
rpoolconfig, pyznap will trigger a snapshot of all child filesystems regardless of whether they have a more specific config. Because therpoolconfig has a non-zeromonthlysetting, this would trigger a monthly snapshot.Interestingly, if
clean = yesforrpool/some-dataset, this snapshot would be taken and then immediately cleaned up!With this PR, this case works as expected, and
rpool/some-datasetwill not have monthly snapshots taken.