From sacadmin Fri Jun  9 16:27:34 2006
Received: from cathy.eng.sun.com (cathy.SFBay.Sun.COM [129.146.228.63])
	by sac.sfbay.sun.com (8.13.6+Sun/8.13.6) with ESMTP id k59NRYo5027258;
	Fri, 9 Jun 2006 16:27:34 -0700 (PDT)
Received: from cathy.eng.sun.com (localhost [127.0.0.1])
	by cathy.eng.sun.com (8.13.6+Sun/8.13.6) with ESMTP id k59NRXdO798497;
	Fri, 9 Jun 2006 16:27:33 -0700 (PDT)
Received: (from bonwick@localhost)
	by cathy.eng.sun.com (8.13.6+Sun/8.13.6/Submit) id k59NRXXY798493;
	Fri, 9 Jun 2006 16:27:33 -0700 (PDT)
Date: Fri, 9 Jun 2006 16:27:33 -0700 (PDT)
From: Jeff Bonwick <bonwick@cathy.eng.sun.com>
Message-Id: <200606092327.k59NRXXY798493@cathy.eng.sun.com>
To: PSARC@sac.sfbay.sun.com
Cc: jeff.bonwick@sun.com, matthew.ahrens@sun.com
Subject: snapshot -r [PSARC/2006/388 Timeout:  06/09/2006]
Status: RO
Content-Length: 3208

Subject: PSARC FastTrack [06/09/2006]: snapshot -r


Template Version: @(#)sac_nextcase 1.56 10/26/05 SMI
Copyright 2006 Sun Microsystems, Inc.
1. Introduction
    1.1. Project/Component Working Name:
	 snapshot -r
    1.2. Name of Document Author/Supplier:
	 Author:  Matt Ahrens
    1.3  Date of This Document:
	09 June, 2006
4. Technical Description
I'm filing this case closed approved automatic.  The change is to add
a '-r' (recursive) option to zfs(1M), so that admins can quickly and
atomically create and destroy snapshots of all filesystems in a tree.

---------------------------------------------------------------------

ZFS makes it easy to create lots of filesystems, and each of those
filesystems can have an unlimited number of snapshots.  One recommended
use case would be to periodically take snapshots of every filesystem.
However, two problems make this suggestion difficult to implement:
(A) sysadmins must write their own script to do 'zfs snapshot' on each
filesystem, and (B) while taking a snapshot is fast, and constant time,
when multiplied by many snapshots, it can take a long time to create
snapshots of lots of filesystems (at around 5 snapshots / second).

The solution is to introduce a "-r" (recursive) flag to 'zfs snapshot'.
This will cause snapshots to be created for all the descendant filesystems
of the one named.  Furthermore, all these snapshots will be created
in one transaction group, so this operation will be extremely fast
(thousands of snapshots / second) and atomic.

Once we make it easy to create lots of snapshots, removing them becomes
an issue.  'zfs destroy -r <snapshot>' will be enhanced to remove all
snapshots with the same name in all descendant filesystems.  Essentially
this gets rid of the snapshots created with 'zfs snapshot -r'.

The manpage changes are below:

in the SYNOPSIS section:

<      zfs snapshot filesystem@name|volume@name
---
>      zfs snapshot [-r] filesystem@name|volume@name


in the DESCRIPTION - Subcommands - destroy section:

<          -r     Recursively destroy all children.
---
>          -r     Recursively destroy all children.  If a snapshot is
>                 specified, destroy all snapshots with this name in
>                 descendent filesystems.


In the DESCRIPTION - Subcommands - snapshot section:

<      zfs snapshot filesystem@name|volume@name
---
>      zfs snapshot [-r] filesystem@name|volume@name
...
>          -r     Recursively create snapshots of all descendant datasets.


In the EXAMPLES section:

>      Example 3: Taking multiple snapshots
>
>      The following command creates snapshots named  "yesterday" of
>      pool/home and all of its descendent filesystems.  For example,
>      it might create snapshots named pool/home@yesterday,
>      pool/home/ahrens@yesterday, pool/home/bonwick@yesterday,
>      pool/home/bonwick/bugs@yesterday.  Each snapshot will be mounted
>      on demand in the ".snapshot" directory at the root of its
>      filesystem.
> 
>           # zfs snapshot -r pool/home@yesterday


6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: FastTrack

From sacadmin Mon Jun 12 01:51:34 2006
Received: from sfbaymail2sca.sfbay.sun.com (sfbaymail2sca.SFBay.Sun.COM [129.145.155.42])
	by sac.sfbay.sun.com (8.13.6+Sun/8.13.6) with ESMTP id k5C8pYXB027382
	for <PSARC@sac.sfbay.sun.com>; Mon, 12 Jun 2006 01:51:34 -0700 (PDT)
Received: from gmpea-pix-1.sun.com (gmpes-gis-mail-2.UK.Sun.COM [129.156.42.6])
	by sfbaymail2sca.sfbay.sun.com (8.13.6+Sun/8.12.10/ENSMAIL,v2.2) with ESMTP id k5C8pX6v016734
	for <PSARC@sac.sfbay.sun.com>; Mon, 12 Jun 2006 01:51:33 -0700 (PDT)
Received: from d1-emea-04.sun.com ([192.18.2.114])
	by gmpea-pix-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k5C8pRM1016903
	for <PSARC@sac.sfbay.sun.com>; Mon, 12 Jun 2006 09:51:27 +0100 (BST)
Received: from conversion-daemon.d1-emea-04.sun.com by d1-emea-04.sun.com
 (Sun Java System Messaging Server 6.2-4.02 (built Sep  9 2005))
 id <0J0Q00H01O6IOZ00@d1-emea-04.sun.com>
 (original mail from Darren.Moffat@Sun.COM) for PSARC@sac.sfbay.sun.com; Mon,
 12 Jun 2006 09:51:27 +0100 (BST)
Received: from [129.156.173.21] by d1-emea-04.sun.com
 (Sun Java System Messaging Server 6.2-4.02 (built Sep  9 2005))
 with ESMTPSA id <0J0Q00AOXOLQQ440@d1-emea-04.sun.com>; Mon,
 12 Jun 2006 09:51:27 +0100 (BST)
Date: Mon, 12 Jun 2006 09:51:26 +0100
From: Darren J Moffat <Darren.Moffat@Sun.COM>
Subject: Re: snapshot -r [PSARC/2006/388 Timeout:  06/09/2006]
In-reply-to: <200606092327.k59NRXXY798493@cathy.eng.sun.com>
Sender: Darren.Moffat@Sun.COM
To: Jeff Bonwick <bonwick@cathy.eng.sun.com>
Cc: PSARC@sac.sfbay.sun.com, jeff.bonwick@Sun.COM, matthew.ahrens@Sun.COM
Message-id: <448D2B0E.7040202@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
References: <200606092327.k59NRXXY798493@cathy.eng.sun.com>
User-Agent: Mail/News 1.5.0.2 (X11/20060515)
Status: RO
Content-Length: 2771

Jeff Bonwick wrote:
> Subject: PSARC FastTrack [06/09/2006]: snapshot -r
> 
> 
> Template Version: @(#)sac_nextcase 1.56 10/26/05 SMI
> Copyright 2006 Sun Microsystems, Inc.
> 1. Introduction
>     1.1. Project/Component Working Name:
> 	 snapshot -r
>     1.2. Name of Document Author/Supplier:
> 	 Author:  Matt Ahrens
>     1.3  Date of This Document:
> 	09 June, 2006
> 4. Technical Description
> I'm filing this case closed approved automatic.  The change is to add
> a '-r' (recursive) option to zfs(1M), so that admins can quickly and
> atomically create and destroy snapshots of all filesystems in a tree.
> 
> ---------------------------------------------------------------------
> 
> ZFS makes it easy to create lots of filesystems, and each of those
> filesystems can have an unlimited number of snapshots.  One recommended
> use case would be to periodically take snapshots of every filesystem.
> However, two problems make this suggestion difficult to implement:
> (A) sysadmins must write their own script to do 'zfs snapshot' on each
> filesystem, and (B) while taking a snapshot is fast, and constant time,
> when multiplied by many snapshots, it can take a long time to create
> snapshots of lots of filesystems (at around 5 snapshots / second).
> 
> The solution is to introduce a "-r" (recursive) flag to 'zfs snapshot'.
> This will cause snapshots to be created for all the descendant filesystems
> of the one named.  Furthermore, all these snapshots will be created
> in one transaction group, so this operation will be extremely fast
> (thousands of snapshots / second) and atomic.
> 
> Once we make it easy to create lots of snapshots, removing them becomes
> an issue.  'zfs destroy -r <snapshot>' will be enhanced to remove all
> snapshots with the same name in all descendant filesystems.  Essentially
> this gets rid of the snapshots created with 'zfs snapshot -r'.
> 
> The manpage changes are below:
> 
> in the SYNOPSIS section:
> 
> <      zfs snapshot filesystem@name|volume@name
> ---
>>      zfs snapshot [-r] filesystem@name|volume@name
> 
> 
> in the DESCRIPTION - Subcommands - destroy section:
> 
> <          -r     Recursively destroy all children.
> ---
>>          -r     Recursively destroy all children.  If a snapshot is
>>                 specified, destroy all snapshots with this name in
>>                 descendent filesystems.

Can you add an example of this usage to the man page
it appears that what you mean is something like this:

$ zfs snapshot -r tank/home@today
....
$ zfs destroy -r tank/home@today

I just want to be sure because when I initially read it I thought
it would be:

$ zfs destroy -r @today

then released that wouldn't work because you need at least a pool
name.

-- 
Darren J Moffat

From sacadmin Mon Jun 12 05:11:42 2006
Received: from phorcys.East.Sun.COM (phorcys.East.Sun.COM [129.148.174.143])
	by sac.sfbay.sun.com (8.13.6+Sun/8.13.6) with ESMTP id k5CCBfQa002117
	for <PSARC@sac.sfbay.sun.com>; Mon, 12 Jun 2006 05:11:42 -0700 (PDT)
Received: from phorcys.East.Sun.COM (localhost [127.0.0.1])
	by phorcys.East.Sun.COM (8.13.6+Sun/8.13.6) with ESMTP id k5CCCQdA005098;
	Mon, 12 Jun 2006 08:12:26 -0400 (EDT)
Received: (from carlsonj@localhost)
	by phorcys.East.Sun.COM (8.13.6+Sun/8.13.6/Submit) id k5CCCQJh005095;
	Mon, 12 Jun 2006 08:12:26 -0400 (EDT)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <17549.23081.909218.554635@gargle.gargle.HOWL>
Date: Mon, 12 Jun 2006 08:12:25 -0400
From: James Carlson <james.d.carlson@sun.com>
To: Jeff Bonwick <bonwick@cathy.eng.sun.com>
Cc: PSARC@sac.sfbay.sun.com, jeff.bonwick@sun.com, matthew.ahrens@sun.com
Subject: Re: snapshot -r [PSARC/2006/388 Timeout:  06/09/2006]
In-Reply-To: Jeff Bonwick's message of 9 June 2006 16:27:33
References: <200606092327.k59NRXXY798493@cathy.eng.sun.com>
X-Mailer: VM 7.01 under Emacs 21.3.1
Status: RO
Content-Length: 652

Jeff Bonwick writes:
> I'm filing this case closed approved automatic.  The change is to add
> a '-r' (recursive) option to zfs(1M), so that admins can quickly and
> atomically create and destroy snapshots of all filesystems in a tree.

Nit: this new option needs a stability level and release binding.  I'd
assume it's Evolving (like the rest of /sbin/zfs) and has Patch/Micro
release binding (so that it can go in an update).

-- 
James Carlson, KISS Network                    <james.d.carlson@sun.com>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

From sacadmin Mon Jun 12 08:24:37 2006
Received: from pacifica.sfbay.sun.com (pacifica.SFBay.Sun.COM [129.146.228.204])
	by sac.sfbay.sun.com (8.13.6+Sun/8.13.6) with ESMTP id k5CFObxX006485
	for <PSARC@sac.sfbay.sun.com>; Mon, 12 Jun 2006 08:24:37 -0700 (PDT)
Received: from pacifica.sfbay.sun.com (localhost [127.0.0.1])
	by pacifica.sfbay.sun.com (8.13.5+Sun/8.13.5) with ESMTP id k5CFLrKT260957;
	Mon, 12 Jun 2006 08:21:53 -0700 (PDT)
Received: (from ahrens@localhost)
	by pacifica.sfbay.sun.com (8.13.5+Sun/8.13.5/Submit) id k5CFLr2p260956;
	Mon, 12 Jun 2006 08:21:53 -0700 (PDT)
Date: Mon, 12 Jun 2006 08:21:53 -0700
From: Matthew Ahrens <ahrens@eng.sun.com>
To: Darren J Moffat <Darren.Moffat@sun.com>
Cc: Jeff Bonwick <bonwick@cathy.eng.sun.com>, PSARC@sac.sfbay.sun.com,
        jeff.bonwick@sun.com
Subject: Re: snapshot -r [PSARC/2006/388 Timeout:  06/09/2006]
Message-ID: <20060612152151.GG243593@eng.sun.com>
References: <200606092327.k59NRXXY798493@cathy.eng.sun.com> <448D2B0E.7040202@Sun.COM>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <448D2B0E.7040202@Sun.COM>
User-Agent: Mutt/1.4.2.1i
Status: RO
Content-Length: 534

On Mon, Jun 12, 2006 at 09:51:26AM +0100, Darren J Moffat wrote:
> Can you add an example of this usage to the man page
> it appears that what you mean is something like this:
> 
> $ zfs snapshot -r tank/home@today
> ....
> $ zfs destroy -r tank/home@today
> 
> I just want to be sure because when I initially read it I thought
> it would be:
> 
> $ zfs destroy -r @today
> 
> then released that wouldn't work because you need at least a pool
> name.

Sure, I will add 'zfs destroy -r pool/home@yesterday' to the new
example.

--matt

From sacadmin Mon Jun 12 08:24:58 2006
Received: from pacifica.sfbay.sun.com (pacifica.SFBay.Sun.COM [129.146.228.204])
	by sac.sfbay.sun.com (8.13.6+Sun/8.13.6) with ESMTP id k5CFOwks006502
	for <PSARC@sac.sfbay.sun.com>; Mon, 12 Jun 2006 08:24:58 -0700 (PDT)
Received: from pacifica.sfbay.sun.com (localhost [127.0.0.1])
	by pacifica.sfbay.sun.com (8.13.5+Sun/8.13.5) with ESMTP id k5CFMEtA260964;
	Mon, 12 Jun 2006 08:22:14 -0700 (PDT)
Received: (from ahrens@localhost)
	by pacifica.sfbay.sun.com (8.13.5+Sun/8.13.5/Submit) id k5CFMEGA260963;
	Mon, 12 Jun 2006 08:22:14 -0700 (PDT)
Date: Mon, 12 Jun 2006 08:22:14 -0700
From: Matthew Ahrens <ahrens@eng.sun.com>
To: James Carlson <james.d.carlson@sun.com>
Cc: Jeff Bonwick <bonwick@cathy.eng.sun.com>, PSARC@sac.sfbay.sun.com,
        jeff.bonwick@sun.com
Subject: Re: snapshot -r [PSARC/2006/388 Timeout:  06/09/2006]
Message-ID: <20060612152214.GH243593@eng.sun.com>
References: <200606092327.k59NRXXY798493@cathy.eng.sun.com> <17549.23081.909218.554635@gargle.gargle.HOWL>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <17549.23081.909218.554635@gargle.gargle.HOWL>
User-Agent: Mutt/1.4.2.1i
Status: RO
Content-Length: 532

On Mon, Jun 12, 2006 at 08:12:25AM -0400, James Carlson wrote:
> Jeff Bonwick writes:
> > I'm filing this case closed approved automatic.  The change is to add
> > a '-r' (recursive) option to zfs(1M), so that admins can quickly and
> > atomically create and destroy snapshots of all filesystems in a tree.
> 
> Nit: this new option needs a stability level and release binding.  I'd
> assume it's Evolving (like the rest of /sbin/zfs) and has Patch/Micro
> release binding (so that it can go in an update).

That's correct.

--matt

