Skip to content

Commit

Permalink
Wait for resilver after online
Browse files Browse the repository at this point in the history
This test performs a rapid offline/online cycle of each of several
mirror vdevs.  It can run so quickly that there isn't sufficient pool
redundancy to perform an offline.  The solution is to wait until the
pool is resilvered following the online operation.

Also, add a pool sync before the offline operation to help reduce
spurious errors.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Issue openzfs#6900
  • Loading branch information
dweeezil authored and behlendorf committed Apr 14, 2018
1 parent 5c596ba commit 4b0f5b2
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ if [[ -z $DISKLIST ]]; then
fi

typeset -i i=0
typeset -i j=0

for disk in $DISKLIST; do
i=0
while [[ $i -lt ${#args[*]} ]]; do

log_must sync_pool $TESTPOOL
log_must zpool offline $TESTPOOL $disk
check_state $TESTPOOL $disk "offline"
if [[ $? != 0 ]]; then
Expand All @@ -87,6 +90,14 @@ for disk in $DISKLIST; do
log_fail "$disk of $TESTPOOL did not match online state"
fi

while [[ $j -lt 20 ]]; do
is_pool_resilvered $TESTPOOL && break
sleep 0.5
(( j = j + 1 ))
done
is_pool_resilvered $TESTPOOL || \
log_file "Pool didn't resilver after online"

(( i = i + 1 ))
done
done
Expand Down

0 comments on commit 4b0f5b2

Please sign in to comment.