diff options
author | Ravishankar N <ravishankar@redhat.com> | 2017-05-05 22:19:36 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-05-12 13:36:40 +0000 |
commit | 3769fe7bf3c2674cf3ed233e79afd039e1ce6ddc (patch) | |
tree | bcbd9a5eeb2795f599d41716a509b515f633676e /tests/bugs/replicate | |
parent | a9c09c5fe97c6861fa3b500b690ebd5df063d0be (diff) |
afr: include quorum type and count when dumping afr priv
Squash of https://review.gluster.org/17196 and
https://review.gluster.org/17215
Dump the client quorum type ('auto', 'fixed' or 'none'). If it is 'fixed',
also dump the quorum-count. This information will be available in the client
statedump and in
/<fuse_mount>/.meta/graphs/active/testvol-replicate-X/private.
Also added a test-case.
Change-Id: I91367c5250b26efb35e5f7d7c397def09cc77cbc
BUG: 1449921
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: https://review.gluster.org/17243
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'tests/bugs/replicate')
-rw-r--r-- | tests/bugs/replicate/bug-1448804-check-quorum-type-values.t | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/bugs/replicate/bug-1448804-check-quorum-type-values.t b/tests/bugs/replicate/bug-1448804-check-quorum-type-values.t new file mode 100644 index 00000000000..4b654e704c5 --- /dev/null +++ b/tests/bugs/replicate/bug-1448804-check-quorum-type-values.t @@ -0,0 +1,47 @@ +#!/bin/bash +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..1} +TEST $CLI volume start $V0 +EXPECT 'Started' volinfo_field $V0 'Status' + +TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0; + + +# Default quorum-type for replica 2 is none. quorum-count is zero but it is not displayed. +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "none" echo `cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-type|awk '{print $3}'` +cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-count +TEST [ $? -ne 0 ] + +# Convert to replica-3. +TEST $CLI volume add-brick $V0 replica 3 $H0:$B0/${V0}2 +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" afr_child_up_status $V0 2 + +# Default quorum-type for replica 3 is auto. quorum-count is INT_MAX but it is not displayed. +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "auto" echo `cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-type|awk '{print $3}'` +cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-count +TEST [ $? -ne 0 ] + +# Change the type to fixed. +TEST $CLI volume set $V0 cluster.quorum-type fixed +# We haven't set quorum-count yet, so it takes the default value of zero in reconfigure() and hence the quorum-type is displayed as none. +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "none" echo `cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-type|awk '{print $3}'` +cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-count +TEST [ $? -ne 0 ] + +# set quorum-count and check. +TEST $CLI volume set $V0 cluster.quorum-count 1 +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "fixed" echo `cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-type|awk '{print $3}'` +EXPECT "1" echo `cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-count|awk '{print $3}'` + +# reset to default values. +TEST $CLI volume reset $V0 cluster.quorum-type +EXPECT_WITHIN $CONFIG_UPDATE_TIMEOUT "auto" echo `cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-type|awk '{print $3}'` +cat $M0/.meta/graphs/active/$V0-replicate-0/private|grep quorum-count +TEST [ $? -ne 0 ] + +cleanup; |