-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Allow zfs to send replication streams with missing snapshots #11710
Conversation
one comment is that the -f flag name is very vague and overused. it might become the norm to use -f without remembering why. can you make it more specific to skipping missing snapshot? |
Yes, that is totally true. Maybe |
Replaced to |
As there were not any other comments, I have finished and pushed the documentation. This should be ready for review. |
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.
Thanks for tackling this! I don't have any objection to adding a command line option to allow this.
tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_skip_missing.ksh
Show resolved
Hide resolved
A tentative implementation and discussion was done in #5285. According to it a send --skip-missing|-s flag has been added. In a replication stream, when there are snapshots missing in the hierarchy, if -s is provided print a warning and ignore dataset (and its children) instead of throwing an error Signed-off-by: Pablo Correa Gómez <[email protected]>
Commit 099fa7e intentionally modified the libzfs ABI. However, it failed to include an update for the libzfs.abi file. This commit resolves the `make checkabi` warning due to that omission. Signed-off-by: Brian Behlendorf <[email protected]> Closes #11710
A tentative implementation and discussion was done in openzfs#5285. According to it a send --skip-missing|-s flag has been added. In a replication stream, when there are snapshots missing in the hierarchy, if -s is provided print a warning and ignore dataset (and its children) instead of throwing an error Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pablo Correa Gómez <[email protected]> Closes openzfs#11710
Commit 099fa7e intentionally modified the libzfs ABI. However, it failed to include an update for the libzfs.abi file. This commit resolves the `make checkabi` warning due to that omission. Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#11710
Commit 099fa7e intentionally modified the libzfs ABI. However, it failed to include an update for the libzfs.abi file. This commit resolves the `make checkabi` warning due to that omission. Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#11710
Before #11710 the flags in zfs-send(8) were sorted. Restore order and bump the date. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11905
Before openzfs#11710 the flags in zfs-send(8) were sorted. Restore order and bump the date. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11905
A tentative implementation and discussion was done in openzfs#5285. According to it a send --skip-missing|-s flag has been added. In a replication stream, when there are snapshots missing in the hierarchy, if -s is provided print a warning and ignore dataset (and its children) instead of throwing an error Reviewed-by: Paul Dagnelie <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pablo Correa Gómez <[email protected]> Closes openzfs#11710
Commit 099fa7e intentionally modified the libzfs ABI. However, it failed to include an update for the libzfs.abi file. This commit resolves the `make checkabi` warning due to that omission. Signed-off-by: Brian Behlendorf <[email protected]> Closes openzfs#11710
Before openzfs#11710 the flags in zfs-send(8) were sorted. Restore order and bump the date. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11905
Motivation and Context
A similar change was proposed previously in #5285 by @loli10K. In the pull request, it was discussed that the integration of OpenZFS 6111 (6635624) reduced the utility of sending replication streams. If there are any datasets in the hierarchy which are not snapshoted, a replication send of any parent will fail due to the missing snapshots. The rationale for that decision is to avoid administrators to think that they've sent all the data when in reality that is not the case. According to #5285, the right way to do this would be to add an extra flag (I chose
-f|--force--skip-missing|-s) which modifies that behavior for administrators which request it.Also, this is my first contribution to the OpenZFS project, so I apologize for any possible newbie mistakes.
I have not added documentation on purpose, because I would like to be sure that the ideas here make sense before putting extra effort into it.Description
This patch adds an extra option (
--skip-missing|-s
) tozfs send
. The skip flag can only be used in conjunction with-R
. In the regular replication behavior, if zfs encounters a dataset without the corresponding snapshot and that was created before the parent snapshot, then an error will occur and the send will be aborted. This MR modifies that behavior, so that if skip flag is also provided, then the dataset and its children will be ignored. Instead of an error, a warning text will be written to stderr and the send will continue.How Has This Been Tested?
One small test has been added to the testsuite, which I could extend if required and some local testing worked without issues.
I have not done any further tests in a real system, but I could also possibly do if needed.I have placed the test underfunctional/cli_root/zfs_send
because it is just a small feature... But I hesitated whether it would fit best underfunctional/rsend
with a bit extra testing. Any suggestions?Types of changes
Checklist:
Signed-off-by
.