Bug 169964 - zfs(8): "zfs receive -F" not destroying snapshots that do not exist on the sending side
Summary: zfs(8): "zfs receive -F" not destroying snapshots that do not exist on the se...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 10:00 UTC by Claudiu Vasadi
Modified: 2018-05-21 06:58 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claudiu Vasadi 2012-07-18 10:00:25 UTC
When sending snapshots to another machine with "zfs receive -F" the snapshots that no longer exist on the sending side, do not get deleted on the receiving side.

How-To-Repeat: Something like this would do:

zfs create rpool/test
zfs snapshot rpool/test@snap1
zfs snapshot rpool/test@snap2
zfs snapshot rpool/test@snap3
zfs snapshot rpool/test@snap4
zfs send rpool/test@snap1 | ssh -c arcfour ssh backup.local zfs receive -F backup/test
zfs send -i snap1 rpool/test@snap2 | ssh -c arcfour ssh backup.local zfs receive -F backup/test
zfs send -i snap2 rpool/test@snap3 | ssh -c arcfour ssh backup.local zfs receive -F backup/test
zfs destroy rpool/test@snap1
zfs send -i snap3 rpool/test@snap4 | ssh -c arcfour ssh backup.local zfs receive -F backup/test

PS: Makes no difference if one uses the "-R" flag for "zfs send" or not.
Comment 1 Fabian Keil 2017-08-29 14:20:42 UTC
The man page could make this more obvious but this is the expected behaviour.

The -F option only affects snapshots located after the snapshot
to which the dataset is rolled back before starting the receive
operation. Without the -F option they would cause the receive
operation to fail.

Snapshots outside the "rollback window" aren't relevant for
the receive operation and thus can be kept.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:53:15 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"
Comment 3 Andriy Gapon freebsd_committer 2018-05-21 06:58:36 UTC
Is this still reproducible with send -R and receive -F?