diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2019-05-06 23:35:08 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-05-10 14:19:29 +0000 |
commit | b475551c66b86863cc93ebdfa6daeeab67bdbd9e (patch) | |
tree | 41abee1e5afbfc9d0891ff949f60bbcf2fbbc892 /tests/bugs | |
parent | 9ab2747da78061882f6734df4b265bce11adaef1 (diff) |
shd/glusterd: Serialize shd manager to prevent race condition
At the time of a glusterd restart, while doing a handshake
there is a possibility that multiple shd manager might get
executed. Because of this, there is a chance that multiple
shd get spawned during a glusterd restart
Change-Id: Ie20798441e07d7d7a93b7d38dfb924cea178a920
fixes: bz#1707081
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/glusterd/serialize-shd-manager-glusterd-restart.t | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/bugs/glusterd/serialize-shd-manager-glusterd-restart.t b/tests/bugs/glusterd/serialize-shd-manager-glusterd-restart.t new file mode 100644 index 00000000000..3a27c2a9d1b --- /dev/null +++ b/tests/bugs/glusterd/serialize-shd-manager-glusterd-restart.t @@ -0,0 +1,54 @@ +#! /bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../cluster.rc + +function check_peers { +count=`$CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l` +echo $count +} + +function check_shd { +ps aux | grep $1 | grep glustershd | wc -l +} + +cleanup + + +TEST launch_cluster 6 + +TESTS_EXPECTED_IN_LOOP=25 +for i in $(seq 2 6); do + hostname="H$i" + TEST $CLI_1 peer probe ${!hostname} +done + + +EXPECT_WITHIN $PROBE_TIMEOUT 5 check_peers; +for i in $(seq 1 5); do + + TEST $CLI_1 volume create ${V0}_$i replica 3 $H1:$B1/${V0}_$i $H2:$B2/${V0}_$i $H3:$B3/${V0}_$i $H4:$B4/${V0}_$i $H5:$B5/${V0}_$i $H6:$B6/${V0}_$i + TEST $CLI_1 volume start ${V0}_$i force + +done + +#kill a node +TEST kill_node 3 + +TEST $glusterd_3; +EXPECT_WITHIN $PROBE_TIMEOUT 5 check_peers + +EXPECT_WITHIN $PROCESS_UP_TIMEOUT 1 check_shd $H3 + +for i in $(seq 1 5); do + + TEST $CLI_1 volume stop ${V0}_$i + TEST $CLI_1 volume delete ${V0}_$i + +done + +for i in $(seq 1 6); do + hostname="H$i" + EXPECT_WITHIN $PROCESS_DOWN_TIMEOUT 0 check_shd ${!hostname} +done +cleanup |