summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawa@redhat.com>2016-09-13 18:27:45 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-09-26 10:30:40 -0700
commit7a80b6128ad91c1174a79b4fa6a0340dfd0b6d6b (patch)
treef79c92887155c2038db90200f1f3d2d550538ef2
parent5afc6aba906a21aee19c2f1baaa7d9eb762ae0ac (diff)
glusterd: "gluster v heal test statistics heal-count replica" output is not correct
Problem : "gluster v heal test statistcs heal-count replica" does not show correct output. Solution: After update condition (match brick name) in _select_hxlator_with_matching_brick, it shows correct output. BUG: 1325792 Change-Id: I60cc7c68ea70bce267a747570f91dcddbc1d9016 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com> Reviewed-on: http://review.gluster.org/15494 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
-rw-r--r--tests/bugs/replicate/bug-1325792.t25
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c5
2 files changed, 27 insertions, 3 deletions
diff --git a/tests/bugs/replicate/bug-1325792.t b/tests/bugs/replicate/bug-1325792.t
new file mode 100644
index 00000000000..73190e5f341
--- /dev/null
+++ b/tests/bugs/replicate/bug-1325792.t
@@ -0,0 +1,25 @@
+#!/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,2,3}
+TEST $CLI volume start $V0
+
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
+
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" afr_child_up_status $V0 0
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" afr_child_up_status $V0 1
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" afr_child_up_status $V0 2
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" afr_child_up_status $V0 3
+
+
+EXPECT 1 echo `$CLI volume heal $V0 statistics heal-count replica $H0:$B0/${V0}0 | grep -A 1 ${V0}0 | grep "entries" | wc -l`
+EXPECT 1 echo `$CLI volume heal $V0 statistics heal-count replica $H0:$B0/${V0}1 | grep -A 1 ${V0}1 | grep "entries" | wc -l`
+EXPECT 1 echo `$CLI volume heal $V0 statistics heal-count replica $H0:$B0/${V0}2 | grep -A 1 ${V0}2 | grep "entries" | wc -l`
+EXPECT 1 echo `$CLI volume heal $V0 statistics heal-count replica $H0:$B0/${V0}3 | grep -A 1 ${V0}3 | grep "entries" | wc -l`
+
+cleanup
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 41a882a198d..502353f62b1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -6281,13 +6281,11 @@ _select_hxlator_with_matching_brick (xlator_t *this,
glusterd_volinfo_t *volinfo, dict_t *dict,
int *index)
{
- char *hostname = NULL;
char *path = NULL;
glusterd_brickinfo_t *brickinfo = NULL;
int hxl_children = 0;
if (!dict ||
- dict_get_str (dict, "per-replica-cmd-hostname", &hostname) ||
dict_get_str (dict, "per-replica-cmd-path", &path))
return -1;
@@ -6299,7 +6297,8 @@ _select_hxlator_with_matching_brick (xlator_t *this,
if (gf_uuid_is_null (brickinfo->uuid))
(void)glusterd_resolve_brick (brickinfo);
- if (!gf_uuid_compare (MY_UUID, brickinfo->uuid)) {
+ if ((!gf_uuid_compare (MY_UUID, brickinfo->uuid)) &&
+ (!strncmp (brickinfo->path, path, strlen(path)))) {
_add_hxlator_to_dict (dict, volinfo,
((*index) - 1)/hxl_children, 0);
return 1;