diff options
author | Don Brady <[email protected]> | 2023-11-08 11:19:41 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-08 10:19:41 -0800 |
commit | 5caeef02fa531238b4554afc977533382e43314f (patch) | |
tree | 71a5e80f437ae81b3225124b98291aa90a0a3a3d /man | |
parent | 9198de8f1079a8bbb837de3e3f8e236777b1375d (diff) |
RAID-Z expansion feature
This feature allows disks to be added one at a time to a RAID-Z group,
expanding its capacity incrementally. This feature is especially useful
for small pools (typically with only one RAID-Z group), where there
isn't sufficient hardware to add capacity by adding a whole new RAID-Z
group (typically doubling the number of disks).
== Initiating expansion ==
A new device (disk) can be attached to an existing RAIDZ vdev, by
running `zpool attach POOL raidzP-N NEW_DEVICE`, e.g. `zpool attach tank
raidz2-0 sda`. The new device will become part of the RAIDZ group. A
"raidz expansion" will be initiated, and the new device will contribute
additional space to the RAIDZ group once the expansion completes.
The `feature@raidz_expansion` on-disk feature flag must be `enabled` to
initiate an expansion, and it remains `active` for the life of the pool.
In other words, pools with expanded RAIDZ vdevs can not be imported by
older releases of the ZFS software.
== During expansion ==
The expansion entails reading all allocated space from existing disks in
the RAIDZ group, and rewriting it to the new disks in the RAIDZ group
(including the newly added device).
The expansion progress can be monitored with `zpool status`.
Data redundancy is maintained during (and after) the expansion. If a
disk fails while the expansion is in progress, the expansion pauses
until the health of the RAIDZ vdev is restored (e.g. by replacing the
failed disk and waiting for reconstruction to complete).
The pool remains accessible during expansion. Following a reboot or
export/import, the expansion resumes where it left off.
== After expansion ==
When the expansion completes, the additional space is available for use,
and is reflected in the `available` zfs property (as seen in `zfs list`,
`df`, etc).
Expansion does not change the number of failures that can be tolerated
without data loss (e.g. a RAIDZ2 is still a RAIDZ2 even after
expansion).
A RAIDZ vdev can be expanded multiple times.
After the expansion completes, old blocks remain with their old
data-to-parity ratio (e.g. 5-wide RAIDZ2, has 3 data to 2 parity), but
distributed among the larger set of disks. New blocks will be written
with the new data-to-parity ratio (e.g. a 5-wide RAIDZ2 which has been
expanded once to 6-wide, has 4 data to 2 parity). However, the RAIDZ
vdev's "assumed parity ratio" does not change, so slightly less space
than is expected may be reported for newly-written blocks, according to
`zfs list`, `df`, `ls -s`, and similar tools.
Sponsored-by: The FreeBSD Foundation
Sponsored-by: iXsystems, Inc.
Sponsored-by: vStack
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Mark Maybee <[email protected]>
Authored-by: Matthew Ahrens <[email protected]>
Contributions-by: Fedor Uporov <[email protected]>
Contributions-by: Stuart Maybee <[email protected]>
Contributions-by: Thorsten Behrens <[email protected]>
Contributions-by: Fmstrat <[email protected]>
Contributions-by: Don Brady <[email protected]>
Signed-off-by: Don Brady <[email protected]>
Closes #15022
Diffstat (limited to 'man')
-rw-r--r-- | man/man1/ztest.1 | 22 | ||||
-rw-r--r-- | man/man4/zfs.4 | 19 | ||||
-rw-r--r-- | man/man7/zpool-features.7 | 32 | ||||
-rw-r--r-- | man/man8/zpool-attach.8 | 53 | ||||
-rw-r--r-- | man/man8/zpool-wait.8 | 6 |
5 files changed, 111 insertions, 21 deletions
diff --git a/man/man1/ztest.1 b/man/man1/ztest.1 index 64514b317..bbbe751ca 100644 --- a/man/man1/ztest.1 +++ b/man/man1/ztest.1 @@ -52,6 +52,16 @@ .Op Fl T Ar time .Op Fl z Ar zil_failure_rate . +.Nm +.Fl X +.Op Fl VG +.Op Fl s Ar size_of_each_vdev +.Op Fl a Ar alignment_shift +.Op Fl r Ar raidz_disks +.Op Fl R Ar raid_parity +.Op Fl d Ar datasets +.Op Fl t Ar threads +. .Sh DESCRIPTION .Nm was written by the ZFS Developers as a ZFS unit test. @@ -122,11 +132,17 @@ Number of mirror copies. Number of raidz/draid disks. .It Fl R , -raid-parity Ns = (default: Sy 1 ) Raid parity (raidz & draid). -.It Fl K , -raid-kind Ns = Ns Sy raidz Ns | Ns Sy draid Ns | Ns Sy random No (default : Sy random ) +.It Xo +.Fl K , -raid-kind Ns = Ns +.Sy raidz Ns | Ns Sy eraidz Ns | Ns Sy draid Ns | Ns Sy random +(default: +.Sy random Ns +) +.Xc The kind of RAID config to use. With .Sy random -the kind alternates between raidz and draid. +the kind alternates between raidz, eraidz (expandable raidz) and draid. .It Fl D , -draid-data Ns = (default: Sy 4 ) Number of data disks in a dRAID redundancy group. .It Fl S , -draid-spares Ns = (default: Sy 1 ) @@ -181,6 +197,8 @@ to an unsigned 32-bit integer Dump zfs_dbgmsg buffer before exiting due to an error. .It Fl V , -verbose Verbose (use multiple times for ever more verbosity). +.It Fl X , -raidz-expansion +Perform a dedicated raidz expansion test. .El . .Sh EXAMPLES diff --git a/man/man4/zfs.4 b/man/man4/zfs.4 index f9824ac17..574558f9d 100644 --- a/man/man4/zfs.4 +++ b/man/man4/zfs.4 @@ -430,6 +430,19 @@ TXGs must pass before unloading will occur. .It Sy reference_history Ns = Ns Sy 3 Pq uint Maximum reference holders being tracked when reference_tracking_enable is active. +.It Sy raidz_expand_max_copy_bytes Ns = Ns Sy 160MB Pq ulong +Max amount of memory to use for RAID-Z expansion I/O. +This limits how much I/O can be outstanding at once. +. +.It Sy raidz_expand_max_reflow_bytes Ns = Ns Sy 0 Pq ulong +For testing, pause RAID-Z expansion when reflow amount reaches this value. +. +.It Sy raidz_io_aggregate_rows Ns = Ns Sy 4 Pq ulong +For expanded RAID-Z, aggregate reads that have more rows than this. +. +.It Sy reference_history Ns = Ns Sy 3 Pq int +Maximum reference holders being tracked when reference_tracking_enable is +active. . .It Sy reference_tracking_enable Ns = Ns Sy 0 Ns | Ns 1 Pq int Track reference holders to @@ -1781,6 +1794,12 @@ even if there were unrepairable errors. Intended to be used during pool repair or recovery to stop resilvering when the pool is next imported. . +.It Sy zfs_scrub_after_expand Ns = Ns Sy 1 Ns | Ns 0 Pq int +Automatically start a pool scrub after a RAIDZ expansion completes +in order to verify the checksums of all blocks which have been +copied during the expansion. +This is enabled by default and strongly recommended. +. .It Sy zfs_scrub_min_time_ms Ns = Ns Sy 1000 Ns ms Po 1 s Pc Pq uint Scrubs are processed by the sync thread. While scrubbing, it will spend at least this much time diff --git a/man/man7/zpool-features.7 b/man/man7/zpool-features.7 index 3c7b0b345..01dec61b9 100644 --- a/man/man7/zpool-features.7 +++ b/man/man7/zpool-features.7 @@ -767,6 +767,14 @@ as soon as it is enabled and will never return to being .Sy disabled . \*[remount-upgrade] . +.feature org.openzfs raidz_expansion no none +This feature enables the +.Nm zpool Cm attach +subcommand to attach a new device to a RAID-Z group, expanding the total +amount usable space in the pool. +See +.Xr zpool-attach 8 . +. .feature com.delphix redaction_bookmarks no bookmarks extensible_dataset This feature enables the use of redacted .Nm zfs Cm send Ns s , @@ -784,6 +792,18 @@ and so cannot be safely mounted, and their contents cannot be safely read. For more information about redacted receives, see .Xr zfs-send 8 . . +.feature com.delphix redaction_list_spill no redaction_bookmarks +This feature enables the redaction list created by zfs redact to store +many more entries. +It becomes +.Sy active +when a redaction list is created with more than 36 entries, +and returns to being +.Sy enabled +when no long redaction lists remain in the pool. +For more information about redacted sends, see +.Xr zfs-send 8 . +. .feature com.datto resilver_defer yes This feature allows ZFS to postpone new resilvers if an existing one is already in progress. @@ -947,18 +967,6 @@ once all filesystems that have ever had their property set to .Sy zstd are destroyed. -. -.feature com.delphix redaction_list_spill no redaction_bookmarks -This feature enables the redaction list created by zfs redact to store -many more entries. -It becomes -.Sy active -when a redaction list is created with more than 36 entries, -and returns to being -.Sy enabled -when no long redaction lists remain in the pool. -For more information about redacted sends, see -.Xr zfs-send 8 . .El . .Sh SEE ALSO diff --git a/man/man8/zpool-attach.8 b/man/man8/zpool-attach.8 index 73535cbdf..22b1369b6 100644 --- a/man/man8/zpool-attach.8 +++ b/man/man8/zpool-attach.8 @@ -26,7 +26,7 @@ .\" Copyright 2017 Nexenta Systems, Inc. .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved. .\" -.Dd May 15, 2020 +.Dd June 28, 2023 .Dt ZPOOL-ATTACH 8 .Os . @@ -45,7 +45,15 @@ Attaches .Ar new_device to the existing .Ar device . -The existing device cannot be part of a raidz configuration. +The behavior differs depending on if the existing +.Ar device +is a RAID-Z device, or a mirror/plain device. +.Pp +If the existing device is a mirror or plain device +.Pq e.g. specified as Qo Li sda Qc or Qq Li mirror-7 , +the new device will be mirrored with the existing device, a resilver will be +initiated, and the new device will contribute to additional redundancy once the +resilver completes. If .Ar device is not currently part of a mirrored configuration, @@ -62,6 +70,42 @@ creates a three-way mirror, and so on. In either case, .Ar new_device begins to resilver immediately and any running scrub is cancelled. +.Pp +If the existing device is a RAID-Z device +.Pq e.g. specified as Qq Ar raidz2-0 , +the new device will become part of that RAID-Z group. +A "raidz expansion" will be initiated, and once the expansion completes, +the new device will contribute additional space to the RAID-Z group. +The expansion entails reading all allocated space from existing disks in the +RAID-Z group, and rewriting it to the new disks in the RAID-Z group (including +the newly added +.Ar device ) . +Its progress can be monitored with +.Nm zpool Cm status . +.Pp +Data redundancy is maintained during and after the expansion. +If a disk fails while the expansion is in progress, the expansion pauses until +the health of the RAID-Z vdev is restored (e.g. by replacing the failed disk +and waiting for reconstruction to complete). +Expansion does not change the number of failures that can be tolerated +without data loss (e.g. a RAID-Z2 is still a RAID-Z2 even after expansion). +A RAID-Z vdev can be expanded multiple times. +.Pp +After the expansion completes, old blocks retain their old data-to-parity +ratio +.Pq e.g. 5-wide RAID-Z2 has 3 data and 2 parity +but distributed among the larger set of disks. +New blocks will be written with the new data-to-parity ratio (e.g. a 5-wide +RAID-Z2 which has been expanded once to 6-wide, has 4 data and 2 parity). +However, the vdev's assumed parity ratio does not change, so slightly less +space than is expected may be reported for newly-written blocks, according to +.Nm zfs Cm list , +.Nm df , +.Nm ls Fl s , +and similar tools. +.Pp +A pool-wide scrub is initiated at the end of the expansion in order to verify +the checksums of all blocks which have been copied during the expansion. .Bl -tag -width Ds .It Fl f Forces use of @@ -76,16 +120,15 @@ manual page for a list of valid properties that can be set. The only property supported at the moment is .Sy ashift . .It Fl s -The +When attaching to a mirror or plain device, the .Ar new_device is reconstructed sequentially to restore redundancy as quickly as possible. Checksums are not verified during sequential reconstruction so a scrub is started when the resilver completes. -Sequential reconstruction is not supported for raidz configurations. .It Fl w Waits until .Ar new_device -has finished resilvering before returning. +has finished resilvering or expanding before returning. .El . .Sh SEE ALSO diff --git a/man/man8/zpool-wait.8 b/man/man8/zpool-wait.8 index 683b01414..d646d9cc3 100644 --- a/man/man8/zpool-wait.8 +++ b/man/man8/zpool-wait.8 @@ -20,7 +20,7 @@ .\" .\" .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved. +.\" Copyright (c) 2012, 2021 by Delphix. All rights reserved. .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved. .\" Copyright (c) 2017 Datto Inc. .\" Copyright (c) 2018 George Melikov. All Rights Reserved. @@ -57,7 +57,7 @@ immediately. These are the possible values for .Ar activity , along with what each one waits for: -.Bl -tag -compact -offset Ds -width "initialize" +.Bl -tag -compact -offset Ds -width "raidz_expand" .It Sy discard Checkpoint to be discarded .It Sy free @@ -76,6 +76,8 @@ Resilver to cease Scrub to cease .It Sy trim Manual trim to cease +.It Sy raidz_expand +Attaching to a RAID-Z vdev to complete .El .Pp If an |