Add delay between zpool add zvol and zpool destroy

As investigated by #14026, the zpool_add_004_pos can reliably hang if 
the timing is not right. This is caused by a race condition between 
zed doing zpool reopen (due to the zvol being added to the zpool), 
and the command zpool destroy.

This change adds a delay between zpool add zvol and zpool destroy to
avoid these issue, but does not address the underlying problem.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Youzhong Yang <yyang@mathworks.com>
Issue #14026
Closes #14052
This commit is contained in:
youzhongyang 2022-10-21 13:05:13 -04:00 committed by GitHub
parent 72a366f018
commit c5a388a1ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,4 +74,8 @@ log_must zpool add $TESTPOOL $ZVOL_DEVDIR/$TESTPOOL1/$TESTVOL
log_must vdevs_in_pool "$TESTPOOL" "$ZVOL_DEVDIR/$TESTPOOL1/$TESTVOL"
# Give zed a chance to finish processing the event, otherwise
# a race condition can lead to stuck "zpool destroy $TESTPOOL"
sleep 1
log_pass "'zpool add <pool> <vdev> ...' adds zfs volume to the pool successfully"