Skip to content
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 for "zfs receive" to skip existing snapshots #2668

Closed
wants to merge 1 commit into from

Conversation

FransUrbo
Copy link
Contributor

by adding the option "-s" to zfs receive.

Signed-off-by: Turbo Fredriksson [email protected]

Closes: #2666

FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 5, 2014
…xisting snapshots

by adding the option "-s" to zfs receive.

Signed-off-by: Turbo Fredriksson <[email protected]>

Closes: openzfs#2666
@FransUrbo FransUrbo force-pushed the issue-2666 branch 2 times, most recently from 58d7d9d to a934751 Compare September 5, 2014 23:31
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 5, 2014
…xisting snapshots

by adding the option "-s" to zfs receive.

Signed-off-by: Turbo Fredriksson <[email protected]>

Closes: openzfs#2666
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 7, 2014
…xisting snapshots

by adding the option "-s" to zfs receive.

Signed-off-by: Turbo Fredriksson <[email protected]>

Closes: openzfs#2666
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 10, 2014
…xisting snapshots

by adding the option "-s" to zfs receive.

Signed-off-by: Turbo Fredriksson <[email protected]>

Closes: openzfs#2666
FransUrbo added a commit to FransUrbo/zfs that referenced this pull request Sep 14, 2014
…xisting snapshots

by adding the option "-s" to zfs receive.

Signed-off-by: Turbo Fredriksson <[email protected]>

Closes: openzfs#2666
by adding the option "-s" to zfs receive.

Signed-off-by: Turbo Fredriksson <[email protected]>

Closes: openzfs#2666
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the addition on resumable send/recv we should decide if this is still an option which is needed. Part of the original motivation for this change doesn't apply any longer. Streams which were aborted after half a day can just be resumed. Is there any use case where it would make sense to skip existing snapshots?

Assuming that there is this patch needs to be.

  • Rebased against the latest master
  • Have a test case added for this new option
  • Address any the inline review comments.

if (zfs_dataset_exists(hdl, zc.zc_value, ZFS_TYPE_SNAPSHOT) &&
flags->skip) {
(void) printf("skipping snapshot %s - %s already exists\n",
drrb->drr_toname, zc.zc_value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally I'd say never to use printf() in a library function like this. Unfortunately, it's already being done in this function so let's just make sure it's wrapped with an if (flags->verbose) conditional like the other cases.

enabled. If the \fBlz4_compress\fR feature is active on the sending system,
then the receiving system must have that feature enabled as well. See
\fBzpool-features\fR(5) for details on ZFS feature flags and the
\fBembedded_data\fR feature.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unrelated hunk can be dropped, it was added to master in another commit.

.ad
.sp .6
.RS 4n
Skip existing snapshots in a stream.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use a little more explanation.

* be an incremental, or the stream specifies a new fs
* (full stream or clone) and they want us to blow it
* away (and have therefore specified -F and removed any
* snapshots).
*/
if (stream_wantsnewfs) {
if (stream_wantsnewfs && !flags->skip) {
if (!flags->force) {
zcmd_free_nvlists(&zc);
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update this error message to reference the optional `-s' option. Something like "destination '%s' exists\nmust specify -F to overwrite it or -s to skip it"

@behlendorf behlendorf added the Type: Feature Feature request or new feature label Sep 16, 2016
@rlaager
Copy link
Member

rlaager commented Sep 27, 2016

@kpande, can you expand on the use case you are thinking of?

@behlendorf
Copy link
Contributor

Closing this issue until someone has the time to work on it.

@behlendorf behlendorf closed this Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"zfs receive" does not have a continue option
4 participants