summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2016-04-15 16:37:18 +0530
committerAravinda VK <avishwan@redhat.com>2016-04-26 02:00:47 -0700
commitaf0790eb32aebcf672c666b23e0cb49e2b1a9cd1 (patch)
tree8ac662304ca3629ef5835c1b69ee9803741a651a
parent7241756f94c975c89f6dc1023d2403f531e6f5ac (diff)
geo-rep: Fix hostname mismatch between volinfo and geo-rep status
When Volume was created using IP, Gluster Volume info shows IP address But Geo-rep shows hostname if available, So difficult to map the outputs of Volume Info and Georep status output. Schedule Geo-rep script(c#13279) will merge the output of Volume info and Geo-rep status to get offline brick nodes information. This script was failing since host info shown in Volinfo is different from Georep status. Script was showing all nodes as offline. With this patch Geo-rep gets host info from volinfo->bricks instead of getting from hostname. Geo-rep status will now show same hostname/IP which was used in Volume Create. BUG: 1328706 Change-Id: Ib8e56da29129aa19225504a891f9b870f269ab75 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/14005 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> (cherry picked from commit bc89311aff62c78102ab6920077b6782ee99689a) Reviewed-on: http://review.gluster.org/14036
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 5a61c685a95..27a89b01ef3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -3925,8 +3925,9 @@ fetch_data:
sts_val->master[strlen(master)] = '\0';
/* Master Brick Node */
- memcpy (sts_val->node, node, strlen(node));
- sts_val->node[strlen(node)] = '\0';
+ memcpy (sts_val->node, brickinfo->hostname,
+ strlen(brickinfo->hostname));
+ sts_val->node[strlen(brickinfo->hostname)] = '\0';
/* Master Brick Path */
memcpy (sts_val->brick, brickinfo->path,