summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryouzhongyang <[email protected]>2022-10-21 13:05:13 -0400
committerGitHub <[email protected]>2022-10-21 10:05:13 -0700
commitc5a388a1ef071b308ab0985fe831f94639fd4d7c (patch)
treedf97cff3b030e3d4f7068433049e0f10fc2f1c16
parent72a366f0181e541d62c776dbefd12e01f7afd216 (diff)
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 <[email protected]> Signed-off-by: Youzhong Yang <[email protected]> Issue #14026 Closes #14052
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh
index fbaed2af1..646edc1a4 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_004_pos.ksh
@@ -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"