ZFSv28 zfs destroy -r bug.

From: Dillon Kass <lists_at_loveturtle.net>
Date: Tue, 22 Mar 2011 11:41:58 -0400
Hello. I posted this to freebsd-fs yesterday regarding 8.2-R & ZFSv28 patches, this morning I confirmed the same behavior on HEAD so I figured I'd also post it here (and there's higher volume :-)

I also tested this on Solaris 11 express to make sure it's specific to FreeBSD and not some kind of "feature" in newer ZFS versions..

It used to be the case that if you zfs destroy -r pool_at_snapshot as long as any child dataset had _at_snapshot the command would destroy it. In other words, pool_at_snapshot didn't need to exist as long as pool/dataset1_at_snapshot existed. 

Here's how it should work (Solaris 11)

turtle_at_solaris11vm:~# zfs list -t all -r rpool1/test
NAME                         USED  AVAIL  REFER  MOUNTPOINT
rpool1/test                  127K  6.34G    34K  /rpool1/test
rpool1/test/test2             31K  6.34G    31K  /rpool1/test/test2
rpool1/test/test2_at_testsnap      0      -    31K  -
rpool1/test/test3             31K  6.34G    31K  /rpool1/test/test3
rpool1/test/test3_at_testsnap      0      -    31K  -
rpool1/test/test4             31K  6.34G    31K  /rpool1/test/test4
rpool1/test/test4_at_testsnap      0      -    31K  -

turtle_at_solaris11vm:~# zfs destroy -r rpool1_at_testsnap

turtle_at_solaris11vm:~# zfs list -t all -r rpool1/test
NAME                USED  AVAIL  REFER  MOUNTPOINT
rpool1/test         127K  6.34G    34K  /rpool1/test
rpool1/test/test2    31K  6.34G    31K  /rpool1/test/test2
rpool1/test/test3    31K  6.34G    31K  /rpool1/test/test3
rpool1/test/test4    31K  6.34G    31K  /rpool1/test/test4
turtle_at_solaris11vm:~# 

All snapshots named _at_testsnap are deleted even though rpool1_at_testsnap doesn't exist. This is normal behavior.

Here's FreeBSD-CURRENT with v28

fbsd9vm# zfs list -t all -r
NAME                     USED  AVAIL  REFER  MOUNTPOINT
testpool                 475K  19.6G    21K  /testpool
testpool/test             22K  19.6G    22K  /testpool/test
testpool/test_at_testsnap      0      -    22K  -

fbsd9vm# zfs destroy -r testpool_at_testsnap
cannot destroy 'testpool_at_testsnap': dataset does not exist
no snapshots destroyed

fbsd9vm# zfs list -t all -r
NAME                     USED  AVAIL  REFER  MOUNTPOINT
testpool                 475K  19.6G    21K  /testpool
testpool/test             22K  19.6G    22K  /testpool/test
testpool/test_at_testsnap      0      -    22K  -

fbsd9vm# uname -a
FreeBSD fbsd9vm 9.0-CURRENT FreeBSD 9.0-CURRENT #2 r208649M: Mon Mar 21 22:28:02 EDT 2011     root_at_:/usr/obj/usr/src/sys/GENERIC  amd64

I noticed this because zfSnap is unable to destroy old snapshots (except for ones that are done to the entire pool where pool_at_snapshot exists)

Cheers,
Dillon
Received on Tue Mar 22 2011 - 14:42:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:12 UTC