From tim.haley@oracle.com Mon Jul 26 07:39:20 2010
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o6QEdKLw013393
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 26 Jul 2010 07:39:20 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o6QEdJAG005331;
	Mon, 26 Jul 2010 07:39:19 -0700 (PDT)
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 <0L6600I0161JAR00@brm-avmta-1.central.sun.com>; Mon,
 26 Jul 2010 08:39:19 -0600 (MDT)
Received: from sca-ea-mail-4.sun.com ([192.18.43.22])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0L6600DQV61IQ660@brm-avmta-1.central.sun.com>; Mon,
 26 Jul 2010 08:39:19 -0600 (MDT)
Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227])
	by sca-ea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id o6QEdIUQ017944;
 Mon, 26 Jul 2010 14:39:18 +0000 (GMT)
Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155])
	by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1)
 with ESMTP id o6Q0LhHg023799; Mon, 26 Jul 2010 14:39:17 +0000 (GMT)
Received: from abhmt012.oracle.com by acsmt354.oracle.com	with ESMTP id
 436717251280155104; Mon, 26 Jul 2010 07:38:24 -0700
Received: from [172.20.25.27] (/10.85.25.27)
	by default (Oracle Beehive Gateway v4.0)	with ESMTP ; Mon,
 26 Jul 2010 07:38:24 -0700
Date: Mon, 26 Jul 2010 08:38:22 -0600
From: Tim Haley <tim.haley@oracle.com>
Subject: zpool import despite missing log [PSARC/2010/292 Self Review]
To: PSARC-ext@sun.com
Cc: zfs-team@sun.com
Message-id: <4C4D9DDE.9040004@oracle.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
X-Source-IP: acsmt355.oracle.com [141.146.40.155]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A090202.4C4D9E15.02C8:SCFMA4539814,ss=1,pt=113351,fgs=0
User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.10)
 Gecko/20100621 Thunderbird/3.0.5
Status: RO
Content-Length: 5433

I am sponsoring the following case for George Wilson.  Requested binding 
is micro/patch.  Since this is a straight-forward addition of a command 
line option, I think itqualifies for self review.  If an ARC member 
disagrees, let me know and I'll convert to a fast-track.

Template Version: @(#)sac_nextcase 1.70 03/30/10 SMI
This information is Copyright (c) 2010, Oracle and/or its affiliates. 
All rights reserved.
1. Introduction
     1.1. Project/Component Working Name:
          zpool import despite missing log
     1.2. Name of Document Author/Supplier:
          Author:  George Wilson
     1.3  Date of This Document:
         26 July, 2010

4. Technical Description

OVERVIEW:

          ZFS maintains a GUID (global unique identifier) on each device and
          the sum of all GUIDs of a pool are stored into the ZFS uberblock.
          This sum is used to determine the availability of all vdevs
          within a pool when a pool is imported or opened.  Pools which
          contain a separate intent log device (e.g. a slog) will fail to
          import when that device is removed or is otherwise unavailable.
          This proposal aims to address this particular issue.

PROPOSED SOLUTION:

          This fast-track introduce a new command line flag to the
          'zpool import' sub-command.  This new option, '-m', allows
          pools to import even when a log device is missing.  The contents
          of that log device are obviously discarded and the pool will
          operate as if the log device were offlined.

MANPAGE DIFFS:

        zpool import [-o mntopts] [-p property=value] ... [-d dir | -c
cachefile]
-          [-D] [-f] [-R root] [-n] [-F] -a
+          [-D] [-f] [-m] [-R root] [-n] [-F] -a


        zpool import [-o mntopts] [-o property=value] ... [-d dir | -c
cachefile]
-          [-D] [-f] [-R root] [-n] [-F] pool |id [newpool]
+          [-D] [-f] [-m] [-R root] [-n] [-F] pool |id [newpool]

        zpool import [-o mntopts] [ -o property=value] ... [-d dir |
-     -c cachefile] [-D] [-f] [-n] [-F] [-R root] -a
+     -c cachefile] [-D] [-f] [-m] [-n] [-F] [-R root] -a

            Imports all  pools  found  in  the  search  directories.
            Identical to the previous command, except that all pools

+         -m
+
+            Allows a pool to import when there is a missing log device

EXAMPLES:

1). Configuration with a single intent log device:

# zpool status tank
    pool: tank
     state: ONLINE
      scan: none requested
      config:

              NAME        STATE     READ WRITE CKSUM
              tank        ONLINE       0     0     0
                c7t0d0    ONLINE       0     0     0
              logs
                c5t0d0    ONLINE       0     0     0

errors: No known data errors

# zpool import tank
The devices below are missing, use '-m' to import the pool anyway:
              c5t0d0 [log]

cannot import 'tank': one or more devices is currently unavailable

# zpool import -m tank
# zpool status tank
    pool: tank
   state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas
exist for
          the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
     see: http://www.sun.com/msg/ZFS-8000-2Q
    scan: none requested
config:

          NAME                   STATE     READ WRITE CKSUM
          tank                   DEGRADED     0     0     0
            c7t0d0               ONLINE       0     0     0
          logs
            1693927398582730352  UNAVAIL      0     0     0  was
/dev/dsk/c5t0d0

errors: No known data errors

2). Configuration with mirrored intent log device:

# zpool add tank log mirror c5t0d0 c5t1d0
zroot@diskmonster:/dev/dsk# zpool status tank
    pool: tank
   state: ONLINE
    scan: none requested
config:

          NAME        STATE     READ WRITE CKSUM
          tank        ONLINE       0     0     0
            c7t0d0    ONLINE       0     0     0
          logs
            mirror-1  ONLINE       0     0     0
              c5t0d0  ONLINE       0     0     0
              c5t1d0  ONLINE       0     0     0

errors: No known data errors

# zpool import 429789444028972405
The devices below are missing, use '-m' to import the pool anyway:
              mirror-1 [log]
                c5t0d0
                c5t1d0

# zpool import -m tank
# zpool status tank
    pool: tank
   state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas
exist for
          the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
     see: http://www.sun.com/msg/ZFS-8000-2Q
    scan: none requested
config:

          NAME                      STATE     READ WRITE CKSUM
          tank                      DEGRADED     0     0     0
            c7t0d0                  ONLINE       0     0     0
          logs
            mirror-1                UNAVAIL      0     0     0
insufficient replicas
              46385995713041169     UNAVAIL      0     0     0  was
/dev/dsk/c5t0d0
              13821442324672734438  UNAVAIL      0     0     0  was
/dev/dsk/c5t1d0

errors: No known data errors

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


