OpenSolaris

Printable Version Enter a New Search
Bug ID 6658356
Synopsis incremental zfs receive -F does not destroy volumes that were deleted on the send side
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:zfs
Keywords
Responsible Engineer Matthew Ahrens
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_85
Fixed In snv_85
Release Fixed solaris_nevada(snv_85) , solaris_10u6(s10u6_01) (Bug ID:2160953)
Related Bugs 6652378 , 6760062
Submit Date 1-February-2008
Last Update Date 9-May-2008
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.
Work Around
N/A
Comments
N/A