From 560ea705840a25f7ff09db499c23e2c20e306c9f Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Fri, 15 Apr 2016 16:37:18 +0530 Subject: [PATCH 087/104] 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: 1327552 Change-Id: Ib8e56da29129aa19225504a891f9b870f269ab75 Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/14005 Smoke: Gluster Build System Reviewed-by: Saravanakumar Arumugam Reviewed-by: Kotresh HR Reviewed-on: http://review.gluster.org/14036 Reviewed-on: https://code.engineering.redhat.com/gerrit/73026 --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 5 +++-- 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 5a61c68..27a89b0 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, -- 1.7.1