diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2016-07-22 07:48:27 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-07-22 14:32:41 -0700 |
commit | b1559c2d1cfcff76df5870563a84cc22c752cc58 (patch) | |
tree | 1ae4fcd6741c4d46831959e8384e41a44c0cefb8 /tests/basic/afr/split-brain-favorite-child-policy.t | |
parent | c5bf5d98594a4237a72cf0d3c72925d5a5aa0f69 (diff) |
tests: Fix spurious failures with split-brain-favorite-child-policy.t
Problem:
It is not guranteed that the self-heal daemon would apply the new option
as soon as volume set is executed because all the command gurantees is that
the process is notified of the change in volfile. Shd still needs to fetch
volfile and reconfigure. If the next volume heal command comes even before
the reconfigure happens, then the heal won't happen.
Fix:
Restart shd to make sure it has the option loaded with new value.
BUG: 1358976
Change-Id: I3ed30ebbec17bd06caa632e79e9412564f431b19
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/14978
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Jeff Darcy <jdarcy@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'tests/basic/afr/split-brain-favorite-child-policy.t')
-rw-r--r-- | tests/basic/afr/split-brain-favorite-child-policy.t | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/basic/afr/split-brain-favorite-child-policy.t b/tests/basic/afr/split-brain-favorite-child-policy.t index 66fcd67a031..7a14852685c 100644 --- a/tests/basic/afr/split-brain-favorite-child-policy.t +++ b/tests/basic/afr/split-brain-favorite-child-policy.t @@ -45,6 +45,10 @@ EXPECT "1" echo $? #We know that the first brick has latest ctime. LATEST_CTIME_MD5=$(md5sum $B0/${V0}0/file | cut -d\ -f1) TEST $CLI volume set $V0 cluster.favorite-child-policy ctime +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 cat $M0/file > /dev/null @@ -79,6 +83,10 @@ EXPECT "1" echo $? #We know that the second brick has latest mtime. LATEST_CTIME_MD5=$(md5sum $B0/${V0}1/file | cut -d\ -f1) TEST $CLI volume set $V0 cluster.favorite-child-policy mtime +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 cat $M0/file > /dev/null @@ -113,6 +121,10 @@ EXPECT "1" echo $? #We know that the second brick has the bigger size file. BIGGER_FILE_MD5=$(md5sum $B0/${V0}1/file | cut -d\ -f1) TEST $CLI volume set $V0 cluster.favorite-child-policy size +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 cat $M0/file > /dev/null @@ -164,6 +176,11 @@ EXPECT "1" echo $? #We know that the second and third bricks agree with each other. Pick any one of them. MAJORITY_MD5=$(md5sum $B0/${V0}1/file | cut -d\ -f1) TEST $CLI volume set $V0 cluster.favorite-child-policy majority +TEST $CLI volume start $V0 force +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 1 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_in_shd $V0 2 TEST $CLI volume heal $V0 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0 cat $M0/file > /dev/null |