diff options
Diffstat (limited to 'tests/bitrot/bug-1373520.t')
| -rw-r--r-- | tests/bitrot/bug-1373520.t | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/tests/bitrot/bug-1373520.t b/tests/bitrot/bug-1373520.t index 271bb3de287..6af5124e86e 100644 --- a/tests/bitrot/bug-1373520.t +++ b/tests/bitrot/bug-1373520.t @@ -11,13 +11,20 @@ TEST pidof glusterd #Create a disperse volume TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{0..5} TEST $CLI volume start $V0 +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "6" online_brick_count EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status' -#Disable md-cache +#Disable self heal daemon as it races in this test with lookup on volume +#stop and start. +$CLI volume set $V0 self-heal-daemon off + +#Disable few perf xlators to get the first lookup on the brick TEST $CLI volume set $V0 performance.stat-prefetch off +TEST $CLI volume set $V0 performance.force-readdirp off +TEST $CLI volume set $V0 dht.force-readdirp off #Mount the volume -TEST $GFS -s $H0 --volfile-id $V0 $M0 +TEST $GFS -s $H0 --use-readdirp=no --attribute-timeout=0 --entry-timeout=0 --volfile-id $V0 $M0 EXPECT_WITHIN $CHILD_UP_TIMEOUT "6" ec_child_up_count $V0 0 #Enable bitrot @@ -49,39 +56,16 @@ EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_bitd_count #Delete file and all links from backend TEST rm -rf $(find $B0/${V0}5 -inum $(stat -c %i $B0/${V0}5/FILE1)) -# The test for each file below used to look like this: -# -# TEST stat $M0/FILE1 -# EXPECT_WITHIN $HEAL_TIMEOUT "$SIZE" stat $B0/${V0}5/FILE1 -# -# That didn't really work, because EXPECT_WITHIN would bail immediately if -# 'stat' returned an error - which it would if the file wasn't there yet. -# Since changing this, I usually see at least a few retries, and sometimes more -# than twenty, before the check for HL_FILE1 succeeds. The 'ls' is also -# necessary, to force a name heal as well as data. With both that and the -# 'stat' on $M0 being done here for every retry, there's no longer any need to -# have them elsewhere. -# -# If we had EW_RETRIES support (https://review.gluster.org/#/c/16451/) we could -# use it here to see how many retries are typical on the machines we use for -# regression, and set an appropriate upper bound. As of right now, though, -# that support does not exist yet. -ugly_stat () { - local client_dir=$1 - local brick_dir=$2 - local bare_file=$3 - - ls $client_dir - stat -c %s $client_dir/$bare_file - stat -c %s $brick_dir/$bare_file 2> /dev/null || echo "UNKNOWN" -} +#New mount for recovery +TEST $GFS -s $H0 --use-readdirp=no --attribute-timeout=0 --entry-timeout=0 --volfile-id $V0 $M1 + +$CLI volume set $V0 self-heal-daemon on +TEST $CLI volume heal $V0 #Access files -EXPECT_WITHIN $HEAL_TIMEOUT "$SIZE" ugly_stat $M0 $B0/${V0}5 FILE1 -EXPECT_WITHIN $HEAL_TIMEOUT "$SIZE" ugly_stat $M0 $B0/${V0}5 HL_FILE1 +TEST cat $M1/FILE1 +EXPECT_WITHIN $HEAL_TIMEOUT "$SIZE" path_size $B0/${V0}5/FILE1 +TEST cat $M1/HL_FILE1 +EXPECT_WITHIN $HEAL_TIMEOUT "$SIZE" path_size $B0/${V0}5/HL_FILE1 cleanup; -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=1417540 -#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=1417540 - - |
