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

receive -F from incremental non-replication send stream deletes destination snapshots #4591

Closed
rfehren opened this issue May 3, 2016 · 3 comments

Comments

@rfehren
Copy link

rfehren commented May 3, 2016

This is with zfs 0.6.5.6
According to the man page receive -F should delete "non-source" snapshots on the destination side only if the send stream was generated with "-R -[iI]". But it does so (randomly) also when sending just with a simple "-i".

Example:

  • Situation before send receive
Existing local snapshots:
----------------------------------------------------------
NAME                            USED  CREATION
ssd/build@daily-1                  0  Tue May  3 15:56 2016
ssd/build@daily-2                  0  Tue May  3 15:52 2016
ssd/build@hourly-1                 0  Tue May  3 15:52 2016
ssd/build@hourly-2                 0  Tue May  3 15:33 2016

Existing snapshots on backup server '*LOCAL*':
----------------------------------------------------------
NAME                            USED  CREATION
sata/bak/ssd/build@daily-2        8K  Tue May  3 15:52 2016
sata/bak/ssd/build@daily-3        8K  Tue May  3 15:34 2016
sata/bak/ssd/build@daily-4        8K  Tue May  3 15:26 2016
sata/bak/ssd/build@hourly-1        0  Tue May  3 15:52 2016
  • Execute
    zfs send -i ssd/build@daily-2 ssd/build@daily-1 | zfs receive -F sata/bak/ssd/build
  • Situation after send receive
Existing local snapshots:
----------------------------------------------------------
NAME                            USED  CREATION
ssd/build@daily-1                  0  Tue May  3 15:56 2016
ssd/build@daily-2                  0  Tue May  3 15:52 2016
ssd/build@hourly-1                 0  Tue May  3 15:52 2016
ssd/build@hourly-2                 0  Tue May  3 15:33 2016

Existing snapshots on backup server '*LOCAL*':
----------------------------------------------------------
NAME                            USED  CREATION
sata/bak/ssd/build@daily-1         0  Tue May  3 15:56 2016
sata/bak/ssd/build@daily-2        8K  Tue May  3 15:52 2016
sata/bak/ssd/build@daily-3        8K  Tue May  3 15:34 2016
sata/bak/ssd/build@daily-4        8K  Tue May  3 15:26 2016

Note that sata/bak/ssd/build@hourly-1 is gone.

@eborisch
Copy link

eborisch commented May 3, 2016

As has been discussed previously in #3010, I (and others) avoid using recv -F unless you really what the behavior it provides. It is likely not the right choice for scripted / automated backups, as an accidental deletion of a child file system (accidents happen, that's at least part of why you backup, right?) on the source will get propagated (and happily applied) to the backup, which doesn't fit my definition of backup.

There's nothing wrong with -F, but it shouldn't be an everyday use flag, but rather a "things got wonky and now I need to repair it carefully" flag.

@rfehren
Copy link
Author

rfehren commented May 6, 2016

Thanks for the comments.
@ptx0: There were a few inherited properties which were different on the receiving side. When I corrected them, using -F became unnecessary. Things work fine now.

@rfehren rfehren closed this as completed May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@rfehren @eborisch and others