From ahrens@sac.sfbay.sun.com Fri Dec  4 16:16:25 2009
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id nB50GPTf012279
	for <psarc-ext@sac.sfbay.sun.com>; Fri, 4 Dec 2009 16:16:25 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.4) with ESMTP id nB50GOD4044897;
	Fri, 4 Dec 2009 17:16:24 -0700 (MST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KU500H01KRC5800@brm-avmta-1.central.sun.com>; Fri,
 04 Dec 2009 17:16:24 -0700 (MST)
Received: from localhost.sfbay.sun.com ([129.146.17.46])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KU500FT3KRCM600@brm-avmta-1.central.sun.com>; Fri,
 04 Dec 2009 17:16:24 -0700 (MST)
Received: from localhost.sfbay.sun.com (localhost [127.0.0.1] (may be forged))
	by localhost.sfbay.sun.com (8.14.3+Sun/8.14.3) with ESMTP id nB50GNO0029752;
 Fri, 04 Dec 2009 16:16:23 -0800 (PST)
Received: (from ahrens@localhost)	by localhost.sfbay.sun.com
 (8.14.3+Sun/8.14.3/Submit) id nB50GNGM029748; Fri,
 04 Dec 2009 16:16:23 -0800 (PST)
Date: Fri, 04 Dec 2009 16:16:23 -0800 (PST)
From: Matthew Ahrens <ahrens@sac.sfbay.sun.com>
Subject: zfs receive -e [PSARC/2009/663 FastTrack timeout 12/16/2009]
To: PSARC-ext@sun.com
Cc: zfs-eng@sun.com
Message-id: <200912050016.nB50GNGM029748@localhost.sfbay.sun.com>
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
Status: RO
Content-Length: 6072


Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 zfs receive -e
    1.2. Name of Document Author/Supplier:
	 Author:  Tom Erickson
    1.3  Date of This Document:
	04 December, 2009
4. Technical Description
4. Technical Description

'zfs receive' destination control

A. SUMMARY

This case adds a -e option to the 'zfs receive' command to request that
only the tail of the sent snapshot path be used to determine the name of
the new received snapshot. Also, it removes the restriction that a
replication stream package sent with 'zfs send -R' must be received
using 'zfs send -d', allowing the administrator to specify the exact
receive path.

B. PROBLEM

Today it is not possible to specify the exact receive path of a
replication stream package, since it is assumed that the administrator
wants to replicate all but the pool name from the snapshot path on the
sending side.

The current behavior is that 'zfs send -R a/b/c | zfs recv -d d/e' will
create d/e/b/c (and descendants). Fishworks wants an option that will
instead create d/e/c (and descendants). Also, backup and restore
capabilities planned for ndmpd require the ability to specify the exact
receive path.

C. PROPOSED SOLUTION

C.1. Overview

The solution adds a -e option to 'zfs receive' similar to the existing
-d option, except that it appends only the tail of sent path to the
specified filesystem. Also it allows the exact path to be specified
where 'zfs send -R' previously restricted the received path to that
derived from the -d option.

C.2. Version Compatibility

There are no compatibility issues. This feature will work the same on
all pool versions.

C.3. Changes to Existing Subcommands

C.3.1 zfs receive
C.3.1.1 zfs receive -e

'zfs receive -d' works as before, appending all but the sent pool name
to the filesystem specified with -d:

% zfs send -R a/b/c@1 | zfs recv -d d/e
% zfs list -t all
: tomee@heavy[13]; zfs list -t all
NAME                              USED  AVAIL  REFER  MOUNTPOINT
..
d/e/b                            43.5K   457G    21K  /d/e/b
d/e/b/c                          22.5K   457G  22.5K  /d/e/b/c
d/e/b/c@1                            0      -  22.5K  -
...

The new 'zfs receive -e' specifies the same filesystem but appends only
the tail of the sent snapshot path:

% zfs send -R a/b/c@1 | zfs recv -e d/e
% zfs list -t all
NAME                              USED  AVAIL  REFER  MOUNTPOINT
...
d/e/c                            22.5K   457G  22.5K  /d/e/c
d/e/c@1                              0      -  22.5K  -
...

'zfs receive' without the -d or -e option now allows the exact receive
path to be specified where 'zfs send -R' previously restricted the
receive path to that derived by -d:

% zfs send -R a/b/c@1 | zfs recv d/e/test
% zfs list -t all
...
d/e/test                         22.5K   457G  22.5K  /d/e/test
d/e/test@1                           0      -  22.5K  -
...
%

C.4. Manpage diffs

< zfs receive [-vnF] -d	filesystem
> zfs receive [-vnF] [-d | -e] filesystem                                       
...
     zfs receive [-vnF]	filesystem|volume|snapshot
     zfs receive [-vnF]	[-d | -e] filesystem
     
...  
         The name of the snapshot (and file  system,  if  a  full
         stream is received) that this subcommand creates depends
<        on the argument type and the -d option.
>        on the argument type and the -d or -e option.                          

         If the	 argument  is  a  snapshot  name,  the	specified
         snapshot is created. If the argument is a filesystem or
         volume name, a snapshot with the same name as the  sent
         snapshot  is  created within the specified filesystem or
<        volume. If the -d option is specified, the snapshot name
<        is  determined  by appending the sent snapshot's name to
<        the specified filesystem. If the -d option is specified,
<        any  required  file systems within the specified one are
<        created.
>        volume. If the -d or -e option is specified, the snapshot              
>        name is determined  by appending the sent snapshot's name              
>        to the specified filesystem. If the -d option is specified,            
>        all but the pool name of the sent snapshot path is appended            
>        (e.g. b/c@1 appended from sent snapshot a/b/c@1), and if
>        the -e option is specified, only the tail of the sent snapshot
>        path is appended (e.g. c@1 appended from sent snapshot
>        a/b/c@1). In the case of -d, any filesystems needed to
>        replicate the path of the sent snapshot are created within
>        the specified filesystem.

         -d
       
<            Use the name of the sent snapshot to  determine  the
<            name  of  the new snapshot as described in the para-
<            graph above.
>            Use all but the first element of the sent snapshot                 
>            path (all but the pool name) to  determine  the name               
>            of  the new snapshot as described in the paragraph                 
>            above.                                                             
>                                                                               
>                                                                               
>        -e                                                                     
>                                                                               
>            Use the last element of the sent snapshot path                     
>            to  determine  the name  of  the new snapshot                      
>            as described in the paragraph above.

Stability

This case requests patch/micro release binding.  The new interfaces are
committed. 

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


From Darren.Moffat@Sun.COM Mon Dec  7 02:13:13 2009
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id nB7ADDKJ019913
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 7 Dec 2009 02:13:13 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.4) with ESMTP id nB7ADCKh011598;
	Mon, 7 Dec 2009 03:13:12 -0700 (MST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KUA00H051Q08E00@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 07 Dec 2009 02:13:12 -0800 (PST)
Received: from gmp-eb-inf-2.sun.com ([192.18.6.24])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KUA003LZ1PZ0G30@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 07 Dec 2009 02:13:12 -0800 (PST)
Received: from fe-emea-09.sun.com
 (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged))
	by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id nB7ADATp002399; Mon,
 07 Dec 2009 10:13:11 +0000 (GMT)
Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KUA00J0015E8B00@fe-emea-09.sun.com>; Mon, 07 Dec 2009 10:13:06 +0000 (GMT)
Received: from [192.168.1.105]
 (cpc2-rdng20-2-0-cust917.15-3.cable.virginmedia.com [86.28.167.150])
 by fe-emea-09.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KUA005NL1PQCZC0@fe-emea-09.sun.com>; Mon,
 07 Dec 2009 10:13:02 +0000 (GMT)
Date: Mon, 07 Dec 2009 10:13:01 +0000
From: Darren J Moffat <Darren.Moffat@Sun.COM>
Subject: Re: zfs receive -e [PSARC/2009/663 FastTrack timeout 12/16/2009]
In-reply-to: <200912050016.nB50GNGM029748@localhost.sfbay.sun.com>
Sender: Darren.Moffat@Sun.COM
To: Matthew Ahrens <ahrens@sac.sfbay.sun.com>
Cc: PSARC-ext@Sun.COM, zfs-eng@Sun.COM
Message-id: <4B1CD52D.2080204@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200912050016.nB50GNGM029748@localhost.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.23 (X11/20091109)
Status: RO
Content-Length: 1068

Matthew Ahrens wrote:
> Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
> This information is Copyright 2009 Sun Microsystems
> 1. Introduction
>     1.1. Project/Component Working Name:
> 	 zfs receive -e
>     1.2. Name of Document Author/Supplier:
> 	 Author:  Tom Erickson
>     1.3  Date of This Document:
> 	04 December, 2009
> 4. Technical Description
> 4. Technical Description
> 
> 'zfs receive' destination control
> 
> A. SUMMARY
> 
> This case adds a -e option to the 'zfs receive' command to request that
> only the tail of the sent snapshot path be used to determine the name of
> the new received snapshot. Also, it removes the restriction that a
> replication stream package sent with 'zfs send -R' must be received
> using 'zfs send -d', allowing the administrator to specify the exact
> receive path.

+1 for this case as specified, I see no issues with this and it is 
particularly nice to see it doesn't require a pool or filesystem version 
bump to use it (being familiar with this area of code that makes sense 
to me).

-- 
Darren J Moffat

From Matthew.Ahrens@sun.com Mon Jan  4 13:19:20 2010
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o04LJKbp026189
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 4 Jan 2010 13:19:20 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail3mpk.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o04LJKqT018716;
	Mon, 4 Jan 2010 13:19:20 -0800 (PST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KVQ00I09R88G900@brm-avmta-1.central.sun.com>; Mon,
 04 Jan 2010 14:19:20 -0700 (MST)
Received: from zion.sfbay.sun.com ([129.146.17.75])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KVQ00DF8R87O020@brm-avmta-1.central.sun.com>; Mon,
 04 Jan 2010 14:19:19 -0700 (MST)
Received: from stationary.local (punchin-ahrens.SFBay.Sun.COM [10.7.251.178])
	by zion.sfbay.sun.com (8.14.3+Sun/8.14.3) with ESMTP id o04LHdT5026446; Mon,
 04 Jan 2010 21:17:39 +0000 (GMT)
Date: Mon, 04 Jan 2010 13:19:19 -0800
From: Matthew Ahrens <Matthew.Ahrens@sun.com>
Subject: Re: zfs receive -e [PSARC/2009/663 FastTrack timeout 12/16/2009]
In-reply-to: <200912050016.nB50GNGM029748@localhost.sfbay.sun.com>
To: Matthew Ahrens <ahrens@dm-eng-01.sfbay.sun.com>
Cc: PSARC-ext@sun.com, zfs-eng@sun.com
Message-id: <4B425B57.4050005@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200912050016.nB50GNGM029748@localhost.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812)
Status: RO
Content-Length: 73

This case was approved at that 12/16/2009 PSARC meeting.

thanks,
--matt

