]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/spa.c
Add device rebuild feature
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 3 Jul 2020 18:05:50 +0000 (11:05 -0700)
committerGitHub <noreply@github.com>
Fri, 3 Jul 2020 18:05:50 +0000 (11:05 -0700)
commit9a49d3f3d3bfa26df4e5e54d574cb490f0ee284b
tree715c2fa00e55762764cadef8460da09f919910ad
parent7ddb753d17f2c12f152647c0e34eb9c42ee5e4af
Add device rebuild feature

The device_rebuild feature enables sequential reconstruction when
resilvering.  Mirror vdevs can be rebuilt in LBA order which may
more quickly restore redundancy depending on the pools average block
size, overall fragmentation and the performance characteristics
of the devices.  However, block checksums cannot be verified
as part of the rebuild thus a scrub is automatically started after
the sequential resilver completes.

The new '-s' option has been added to the `zpool attach` and
`zpool replace` command to request sequential reconstruction
instead of healing reconstruction when resilvering.

    zpool attach -s <pool> <existing vdev> <new vdev>
    zpool replace -s <pool> <old vdev> <new vdev>

The `zpool status` output has been updated to report the progress
of sequential resilvering in the same way as healing resilvering.
The one notable difference is that multiple sequential resilvers
may be in progress as long as they're operating on different
top-level vdevs.

The `zpool wait -t resilver` command was extended to wait on
sequential resilvers.  From this perspective they are no different
than healing resilvers.

Sequential resilvers cannot be supported for RAIDZ, but are
compatible with the dRAID feature being developed.

As part of this change the resilver_restart_* tests were moved
in to the functional/replacement directory.  Additionally, the
replacement tests were renamed and extended to verify both
resilvering and rebuilding.

Original-patch-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: John Poduska <jpoduska@datto.com>
Co-authored-by: Mark Maybee <mmaybee@cray.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10349
70 files changed:
cmd/zed/agents/zfs_mod.c
cmd/zed/agents/zfs_retire.c
cmd/zed/zed.d/resilver_finish-start-scrub.sh
cmd/zpool/zpool_main.c
cmd/ztest/ztest.c
configure.ac
contrib/pyzfs/libzfs_core/_constants.py
include/libzfs.h
include/sys/Makefile.am
include/sys/dsl_scan.h
include/sys/fs/zfs.h
include/sys/spa.h
include/sys/spa_impl.h
include/sys/vdev.h
include/sys/vdev_impl.h
include/sys/vdev_rebuild.h [new file with mode: 0644]
include/sys/zio_priority.h
include/zfeature_common.h
lib/libzfs/libzfs_pool.c
lib/libzfs/libzfs_status.c
lib/libzfs/libzfs_util.c
lib/libzpool/Makefile.am
man/man5/zfs-module-parameters.5
man/man5/zpool-features.5
man/man8/zpool-attach.8
man/man8/zpool-replace.8
man/man8/zpool-status.8
module/Makefile.bsd
module/zcommon/zfeature_common.c
module/zfs/Makefile.in
module/zfs/dsl_scan.c
module/zfs/spa.c
module/zfs/spa_misc.c
module/zfs/vdev.c
module/zfs/vdev_label.c
module/zfs/vdev_mirror.c
module/zfs/vdev_queue.c
module/zfs/vdev_rebuild.c [new file with mode: 0644]
module/zfs/zfs_ioctl.c
tests/runfiles/common.run
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/functional/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_get/zpool_get.cfg
tests/zfs-tests/tests/functional/cli_root/zpool_wait/scan/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_wait/scan/zpool_wait_rebuild.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/Makefile.am
tests/zfs-tests/tests/functional/replacement/attach_import.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/attach_multiple.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/attach_rebuild.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/attach_resilver.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/detach.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/rebuild_disabled_feature.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/rebuild_multiple.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/rebuild_raidz.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/replace_import.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/replace_rebuild.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/replace_resilver.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/replacement.cfg
tests/zfs-tests/tests/functional/replacement/replacement_001_pos.ksh [deleted file]
tests/zfs-tests/tests/functional/replacement/replacement_002_pos.ksh [deleted file]
tests/zfs-tests/tests/functional/replacement/replacement_003_pos.ksh [deleted file]
tests/zfs-tests/tests/functional/replacement/resilver_restart_001.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/resilver_restart_002.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/replacement/scrub_cancel.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/resilver/Makefile.am [deleted file]
tests/zfs-tests/tests/functional/resilver/cleanup.ksh [deleted file]
tests/zfs-tests/tests/functional/resilver/resilver.cfg [deleted file]
tests/zfs-tests/tests/functional/resilver/resilver_restart_001.ksh [deleted file]
tests/zfs-tests/tests/functional/resilver/resilver_restart_002.ksh [deleted file]
tests/zfs-tests/tests/functional/resilver/setup.ksh [deleted file]