Skip to content

Commit

Permalink
Add delay between zpool add zvol and zpool destroy
Browse files Browse the repository at this point in the history
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
  • Loading branch information
youzhongyang authored Oct 21, 2022
1 parent 72a366f commit c5a388a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit c5a388a

Please sign in to comment.