|
Description
|
When zfs receive -F gets an incremental update, it's supposed to "destroy any snapshots and filesystems that do not exist on the sending side" (zfs(1M)). When sending an incremental snapshot containing a volume deletion, zfs receive fails to destroy the volume.
To reproduce, first create a filesystem with a volume inside of it and replicate it. Then remove the volume and create an incremental replication:
# zfs create pool_0/myproj
# zfs create -V 10m pool_0/myproj/myvol
# zfs snapshot -r pool_0/myproj@rr-1
# zfs send -R pool_0/myproj@rr-1 > fullrep
# zfs destroy -r pool_0/myproj/myvol
# zfs snapshot -r pool_0/myproj@rr-2
# zfs send -R -i pool_0/myproj@rr-1 pool_0/myproj@rr-2 > increp
Then on another machine, receive the full replication and then try to receive the incremental replication:
# zfs receive -vd pool < fullrep
# zfs receive -vdF pool < increp
The second command will fail with output like the following:
attempting destroy pool/myproj/myvol@rr-1
success
attempting destroy pool/myproj/myvol
failed - trying rename to pool/myproj/recv-151978-1
failed (2) - will try again on next pass
failed (2)
another pass:
attempting destroy pool/myproj/myvol
failed - trying rename to pool/myproj/recv-151978-2
failed (2) - will try again on next pass
failed (2)
receiving incremental stream of pool_0/myproj@rr-2 into pool/myproj@rr-2
received 312B stream in 2 seconds (156B/sec)
receiving incremental stream of pool_0/myproj/myfs@rr-2 into pool/myproj/myfs@rr-2
received 312B stream in 1 seconds (312B/sec)
attempting destroy pool/myproj/myvol
failed - trying rename to pool/myproj/recv-151978-3
failed (2) - will try again on next pass
failed (2)
and (not surprisingly) the volume isn't deleted.
When I tried to do this on the same machine (deleting pool_0/myproj after saving the snapshots), I got a segfault with the attached corefile.
|