From bc89311aff62c78102ab6920077b6782ee99689a Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Fri, 15 Apr 2016 16:37:18 +0530 Subject: 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: 1327553 Change-Id: Ib8e56da29129aa19225504a891f9b870f269ab75 Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/14005 NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Saravanakumar Arumugam Reviewed-by: Kotresh HR --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 4a535b1b5af..3387f7e62bc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -3920,8 +3920,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, -- cgit