zfs send should ignore datasets created after the ending snapshot
If you create a zfs child folder, zfs send returns an error when a recursive incremental send is done between two snapshots made prior to the folder creation.
The problem can be reproduced with the following steps.
root@zfs:/# zfs create pool/test root@zfs:/# zfs snapshot pool/test@snap1 root@zfs:/# zfs snapshot pool/test@snap2 root@zfs:/# zfs create pool/test/child root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap2 > /dev/null WARNING: could not send pool/test/child@snap2: does not exist WARNING: could not send pool/test/child@snap2: does not exist root@zfs:/# echo $? 1 root@zfs:/# zfs snapshot -r pool/test@snap3 root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap3 > /dev/null root@zfs:/# echo $? 0 root@zfs:/# zfs send -R -I pool/test@snap2 pool/test@snap3 > /dev/null root@zfs:/# echo $? 0
Since pool/test/child was created after snap2, zfs send should not expect snap2 to be in pool/test/child when doing a recursive send. It should examine the compare the creation time of the snapshot and each child folder to decide if the folder will be sent. The next incremental send between snap2 and snap3 would properly create the child folder and snap3 which first appears in the child folder.
The problem is identical if '-i' is used instead of '-I'.
Updated by Electric Monk almost 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 4a20c933b148de8a1c1d3538391c64284e636653 Author: Alex Deiter <firstname.lastname@example.org> Date: 2016-05-11T23:31:37.000Z 6111 zfs send should ignore datasets created after the ending snapshot Reviewed by: Alex Aizman email@example.com Reviewed by: Alek Pinchuk firstname.lastname@example.org Reviewed by: Roman Strashkin email@example.com Reviewed by: Matthew Ahrens <firstname.lastname@example.org> Reviewed by: Paul Dagnelie <email@example.com> Approved by: Garrett D'Amore <firstname.lastname@example.org>
Updated by Duane Leslie over 3 years ago
I have just discovered this change when I updated to FreeBSD 11, and I have to say that it breaks behaviour I relied upon previously, namely that datasets without the `snap2` snapshot would be skipped (with a warning) but the send would be completed. An example of this behaviour is provided in the official Oracle documentation at https://docs.oracle.com/cd/E26502_01/html/E29007/recover-3.html (see step 3).
The new behaviour created by this change now aborts the send in its entirety, whereas previously the send would complete with a non-zero return code.