diff --git a/tests/zfs-tests/include/tunables.cfg b/tests/zfs-tests/include/tunables.cfg index a619b846dd..82a7cac76a 100644 --- a/tests/zfs-tests/include/tunables.cfg +++ b/tests/zfs-tests/include/tunables.cfg @@ -68,6 +68,7 @@ REBUILD_SCRUB_ENABLED rebuild_scrub_enabled zfs_rebuild_scrub_enabled REMOVAL_SUSPEND_PROGRESS removal_suspend_progress zfs_removal_suspend_progress REMOVE_MAX_SEGMENT remove_max_segment zfs_remove_max_segment RESILVER_MIN_TIME_MS resilver_min_time_ms zfs_resilver_min_time_ms +RESILVER_DEFER_PERCENT resilver_defer_percent zfs_resilver_defer_percent SCAN_LEGACY scan_legacy zfs_scan_legacy SCAN_SUSPEND_PROGRESS scan_suspend_progress zfs_scan_suspend_progress SCAN_VDEV_LIMIT scan_vdev_limit zfs_scan_vdev_limit diff --git a/tests/zfs-tests/tests/functional/replacement/resilver_restart_001.ksh b/tests/zfs-tests/tests/functional/replacement/resilver_restart_001.ksh index b498ba4af7..629870adf9 100755 --- a/tests/zfs-tests/tests/functional/replacement/resilver_restart_001.ksh +++ b/tests/zfs-tests/tests/functional/replacement/resilver_restart_001.ksh @@ -96,6 +96,8 @@ set -A RESTARTS -- '1' '2' '2' '2' set -A VDEVS -- '' '' '' '' set -A DEFER_RESTARTS -- '1' '1' '1' '2' set -A DEFER_VDEVS -- '-' '2' '2' '-' +set -A EARLY_RESTART_DEFER_RESTARTS -- '1' '2' '2' '2' +set -A EARLY_RESTART_DEFER_VDEVS -- '' '' '' '' VDEV_REPLACE="${VDEV_FILES[1]} $SPARE_VDEV_FILE" @@ -125,7 +127,7 @@ done wait # test without and with deferred resilve feature enabled -for test in "without" "with" +for test in "without" "with" "with_early_restart" do log_note "Testing $test deferred resilvers" @@ -135,6 +137,13 @@ do RESTARTS=( "${DEFER_RESTARTS[@]}" ) VDEVS=( "${DEFER_VDEVS[@]}" ) VDEV_REPLACE="$SPARE_VDEV_FILE ${VDEV_FILES[1]}" + log_must set_tunable32 RESILVER_DEFER_PERCENT 0 + elif [[ $test == "with_early_restart" ]] + then + RESTARTS=( "${EARLY_RESTART_DEFER_RESTARTS[@]}" ) + VDEVS=( "${EARLY_RESTART_DEFER_VDEVS[@]}" ) + VDEV_REPLACE="${VDEV_FILES[1]} $SPARE_VDEV_FILE" + log_must set_tunable32 RESILVER_DEFER_PERCENT 100 fi # clear the events