From 1477fa442a733d7b1a5ea74884cac8f29fbe7e6a Mon Sep 17 00:00:00 2001 From: Gaurav Yadav Date: Tue, 18 Jul 2017 16:23:18 +0530 Subject: glusterd : glusterd fails to start when peer's network interface is down Problem: glusterd fails to start on nodes where glusterd tries to come up even before network is up. Fix: On startup glusterd tries to resolve brick path which is based on hostname/ip, but in the above scenario when network interface is not up, glusterd is not able to resolve the brick path using ip_address or hostname With this fix glusterd will use UUID to resolve brick path. Change-Id: Icfa7b2652417135530479d0aa4e2a82b0476f710 BUG: 1472267 Signed-off-by: Gaurav Yadav Reviewed-on: https://review.gluster.org/17813 Smoke: Gluster Build System Reviewed-by: Prashanth Pai CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-utils.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index fe1d16865ef..522872d4815 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -1122,15 +1122,22 @@ glusterd_get_next_available_brickid (glusterd_volinfo_t *volinfo) int32_t glusterd_resolve_brick (glusterd_brickinfo_t *brickinfo) { - int32_t ret = -1; - xlator_t *this = NULL; + int32_t ret = -1; + xlator_t *this = NULL; this = THIS; GF_ASSERT (this); GF_ASSERT (brickinfo); + if (!gf_uuid_compare(brickinfo->uuid, MY_UUID) || + (glusterd_peerinfo_find_by_uuid (brickinfo->uuid) != NULL)) { + ret = 0; + goto out; + } ret = glusterd_hostname_to_uuid (brickinfo->hostname, brickinfo->uuid); + +out: gf_msg_debug (this->name, 0, "Returning %d", ret); return ret; } -- cgit