From 6e81337cb410a9b169a878a61d53e972763f7a2c Mon Sep 17 00:00:00 2001 From: Samikshan Bairagya Date: Tue, 6 Jun 2017 17:08:37 +0530 Subject: [PATCH 488/509] glusterd: Fix regression wrt add-brick on replica count change tests/bugs/glusterd/bug-1406411-fail-add-brick-on-replica-count-change.t was failing on centos machines with brick multiplexing enabled. This is because detaching individual bricks manually from the backend like it is done in the regression test framework by 'kill_brick', fails to send a RPC_CLNT_DISCONNECT to glusterd when multiplexing is enabled. This causes the add-brick command to not fail when one of the bricks are killed using kill_brick in the regression test framework. To fix this, set the brick status to GF_BRICK_STOPPED on the glusterd end during portmap signout. This commit also sets the brick status in glusterd_brick_stop() function so that the brick status is correctly set to 'stopped' even when the function is called independently for individual bricks. > Reviewed-on: https://review.gluster.org/17422 > Smoke: Gluster Build System > NetBSD-regression: NetBSD Build System > Reviewed-by: Jeff Darcy > Reviewed-by: Atin Mukherjee > CentOS-regression: Gluster Build System Change-Id: I4d6f7b579069d0cfa53cb2b0cff78876e1f31594 BUG: 1458569 Signed-off-by: Samikshan Bairagya Reviewed-on: https://code.engineering.redhat.com/gerrit/108299 Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-pmap.c | 6 ++++++ xlators/mgmt/glusterd/src/glusterd-utils.c | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c index 1670b38..13b347e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-pmap.c +++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c @@ -594,6 +594,12 @@ __gluster_pmap_signout (rpcsvc_request_t *req) conf); sys_unlink (pidfile); brickinfo->started_here = _gf_false; + + /* Setting the brick status to GF_BRICK_STOPPED to + * ensure correct brick status is maintained on the + * glusterd end when a brick is killed from the + * backend */ + brickinfo->status = GF_BRICK_STOPPED; } } diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 6e0a906..903ee80 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2127,14 +2127,16 @@ glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo, ret = 0; } - if (del_brick) - glusterd_delete_brick (volinfo, brickinfo); - GLUSTERD_GET_BRICK_PIDFILE (pidfile, volinfo, brickinfo, conf); gf_msg_debug (this->name, 0, "Unlinking pidfile %s", pidfile); (void) sys_unlink (pidfile); brickinfo->started_here = _gf_false; + brickinfo->status = GF_BRICK_STOPPED; + + if (del_brick) + glusterd_delete_brick (volinfo, brickinfo); + out: return ret; } -- 1.8.3.1