Skip to content

Commit 11e6837

Browse files
author
Paul Dagnelie
committed
Add testing for sequential resilver
Signed-off-by: Paul Dagnelie <[email protected]>
1 parent 41f5993 commit 11e6837

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

module/zfs/vdev_draid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ vdev_draid_io_start_read(zio_t *zio, raidz_row_t *rr)
19971997
rc->rc_allow_repair = 1;
19981998
}
19991999
}
2000-
2000+
20012001
if (vdev_sit_out_reads(cvd, zio->io_flags)) {
20022002
rr->rr_outlier_cnt++;
20032003
ASSERT0(rc->rc_latency_outlier);

tests/zfs-tests/tests/functional/replacement/replace_resilver_sit_out.ksh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function replace_test
101101
typeset -i iters=2
102102
typeset disk1=$1
103103
typeset disk2=$2
104+
typeset repl_type=$3
104105

105106
typeset i=0
106107
while [[ $i -lt $iters ]]; do
@@ -114,9 +115,13 @@ function replace_test
114115
((i = i + 1))
115116
done
116117

118+
typeset repl_flag="-w"
119+
if [[ "$repl_type" == "seq" ]]; then
120+
repl_flag="-ws"
121+
fi
117122
# replace disk with a slow drive still present
118123
SECONDS=0
119-
log_must zpool replace -w $TESTPOOL1 $disk1 $disk2
124+
log_must zpool replace $repl_flag $TESTPOOL1 $disk1 $disk2
120125
log_note took $SECONDS seconds to replace disk
121126

122127
for wait_pid in $child_pids
@@ -178,7 +183,11 @@ for type in "raidz2" "raidz3" "draid2"; do
178183
log_note took $SECONDS seconds to reach sit out reading ${size}M
179184
log_must zpool status -s $TESTPOOL1
180185

181-
replace_test $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE
186+
typeset repl_type="replace"
187+
if [[ "$type" == "draid2" && $((RANDOM % 2)) -eq 0 ]]; then
188+
repl_type="seq"
189+
fi
190+
replace_test $TESTDIR/$TESTFILE1.1 $TESTDIR/$REPLACEFILE $repl_type
182191

183192
log_must eval "zpool iostat -v $TESTPOOL1 | grep \"$REPLACEFILE\""
184193

0 commit comments

Comments
 (0)