mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 19:39:35 +03:00
9a49d3f3d3
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
20 lines
626 B
Bash
Executable File
20 lines
626 B
Bash
Executable File
#!/bin/sh
|
|
# resilver_finish-start-scrub.sh
|
|
# Run a scrub after a resilver
|
|
#
|
|
# Exit codes:
|
|
# 1: Internal error
|
|
# 2: Script wasn't enabled in zed.rc
|
|
# 3: Scrubs are automatically started for sequential resilvers
|
|
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
|
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
|
|
|
[ "${ZED_SCRUB_AFTER_RESILVER}" = "1" ] || exit 2
|
|
[ "${ZEVENT_RESILVER_TYPE}" != "sequential" ] || exit 3
|
|
[ -n "${ZEVENT_POOL}" ] || exit 1
|
|
[ -n "${ZEVENT_SUBCLASS}" ] || exit 1
|
|
zed_check_cmd "${ZPOOL}" || exit 1
|
|
|
|
zed_log_msg "Starting scrub after resilver on ${ZEVENT_POOL}"
|
|
"${ZPOOL}" scrub "${ZEVENT_POOL}"
|