Skip to content

Commit

Permalink
6249 async_destroy_001_pos fails because it doesn't see 'freeing' pro…
Browse files Browse the repository at this point in the history
…p populated

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
  • Loading branch information
jwk404 authored and ahrens committed Oct 3, 2015
1 parent 999dc7a commit db24175
Showing 1 changed file with 17 additions and 14 deletions.
Expand Up @@ -21,7 +21,7 @@
#

#
# Copyright (c) 2013 by Delphix. All rights reserved.
# Copyright (c) 2013, 2014 by Delphix. All rights reserved.
#

. $STF_SUITE/include/libtest.shlib
Expand Down Expand Up @@ -56,29 +56,32 @@ log_assert "async_destroy can suspend and resume traversal"

log_must $ZFS create -o recordsize=512 -o compression=off $TEST_FS

#
# Fill with 2G
#
log_must $DD bs=1024k count=2048 if=/dev/zero of=/$TEST_FS/file

log_must $ZFS destroy $TEST_FS

#
# We monitor the freeing property, to verify we can see blocks being
# freed while the suspend/resume code is exerciesd.
#
t0=$SECONDS
count=0
while [[ "0" != "$($ZPOOL list -Ho freeing $TESTPOOL)" ]]; do
count=$((count + 1))
sleep 1
while [[ $((SECONDS - t0)) -lt 10 ]]; do
[[ "0" != "$($ZPOOL list -Ho freeing $TESTPOOL)" ]] && ((count++))
[[ $count -gt 1 ]] && break
$SLEEP 1
done

#
# We assert that the data took a few seconds to free to make sure that
# we actually exercised the suspend/resume code. The destroy should
# actually take much longer than this, so false positives are not likely.
#
log_must test $count -gt 5
[[ $count -eq 0 ]] && log_fail "Freeing property remained empty"

# Wait for everything to be freed.
while [[ "0" != "$($ZPOOL list -Ho freeing $TESTPOOL)" ]]; do
[[ $((SECONDS - t0)) -gt 180 ]] && \
log_fail "Timed out waiting for freeing to drop to zero"
done

#
# Check for leaked blocks.
#
log_must $ZDB -b $TESTPOOL

log_pass "async_destroy can suspend and resume traversal"

0 comments on commit db24175

Please sign in to comment.