Illumos 3835 zfs need not store 2 copies of all metadata

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

Description from Matt Ahrens's bug report at Delphix:

    Add a new zfs property, "redundant_metadata" which can have values
    "all" or "most".  The default will be "all", which is the current
    behavior.  Setting to "most" will cause us to only store 1 copy of
    level-1 indirect blocks of user data files.

Additional notes:

    The new man page section for this property states

        "The exact behavior of which metadata blocks
         are stored redundantly may change in future releases."

    and:

        "When set to most, ZFS stores an extra copy of most types of
         metadata. This can improve performance of random writes,
         because less metadata must be written."

    The current implementation is as described above in Matt's blog.
    It is controlled by a new global integer
    "zfs_redundant_metadata_most_ditto_level", currently initialized
    to 2. When "redundant_metadata" is set to "most", only indirect
    blocks of the specified level and higher will have additional ditto
    blocks created.

Ported by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2542
This commit is contained in:
Matthew Ahrens
2014-05-23 08:21:07 -08:00
committed by Brian Behlendorf
parent 603cb25ca5
commit faf0f58c69
7 changed files with 108 additions and 23 deletions
+32 -1
View File
@@ -22,7 +22,7 @@
.\"
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
.\" Copyright (c) 2013 by Delphix. All rights reserved.
.\" Copyright (c) 2014 by Delphix. All rights reserved.
.\" Copyright (c) 2012, Joyent, Inc. All rights reserved.
.\" Copyright 2012 Nexenta Systems, Inc. All Rights Reserved.
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
@@ -1014,6 +1014,37 @@ This property can also be referred to by its shortened column name, \fBrecsize\f
.ne 2
.mk
.na
\fB\fBredundant_metadata\fR=\fBall\fR | \fBmost\fR\fR
.ad
.sp .6
.RS 4n
Controls what types of metadata are stored redundantly. ZFS stores an
extra copy of metadata, so that if a single block is corrupted, the
amount of user data lost is limited. This extra copy is in addition to
any redundancy provided at the pool level (e.g. by mirroring or RAID-Z),
and is in addition to an extra copy specified by the \fBcopies\fR
property (up to a total of 3 copies). For example if the pool is
mirrored, \fBcopies\fR=2, and \fBredundant_metadata\fR=most, then ZFS
stores 6 copies of most metadata, and 4 copies of data and some
metadata.
.sp
When set to \fBall\fR, ZFS stores an extra copy of all metadata. If a
single on-disk block is corrupt, at worst a single block of user data
(which is \fBrecordsize\fR bytes long) can be lost.
.sp
When set to \fBmost\fR, ZFS stores an extra copy of most types of
metadata. This can improve performance of random writes, because less
metadata must be written. In practice, at worst about 100 blocks (of
\fBrecordsize\fR bytes each) of user data can be lost if a single
on-disk block is corrupt. The exact behavior of which metadata blocks
are stored redundantly may change in future releases.
.sp
The default value is \fBall\fR.
.RE
.sp
.ne 2
.na
\fB\fBrefquota\fR=\fIsize\fR | \fBnone\fR\fR
.ad
.sp .6