From 4da244caccd38a77de5428b6954f565219ef0719 Mon Sep 17 00:00:00 2001 From: Sanju Rakonde Date: Fri, 6 Apr 2018 01:53:45 +0530 Subject: glusterd: handling brick termination in brick-mux Problem: There's a race between the glusterfs_handle_terminate() response sent to glusterd from last brick of the process and the socket disconnect event that encounters after the brick process got killed. Solution: When it is a last brick for the brick process, instead of sending GLUSTERD_BRICK_TERMINATE to brick process, glusterd will kill the process (same as we do it in case of non brick multiplecing). The test case is added for https://bugzilla.redhat.com/show_bug.cgi?id=1549996 Change-Id: If94958cd7649ea48d09d6af7803a0f9437a85503 fixes: bz#1545048 Signed-off-by: Sanju Rakonde --- xlators/mgmt/glusterd/src/glusterd-syncop.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index 31b08d76ad..e5d4421deb 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -958,7 +958,6 @@ gd_syncop_mgmt_brick_op (struct rpc_clnt *rpc, glusterd_pending_node_t *pnode, gd1_mgmt_brick_op_req *req = NULL; int ret = 0; xlator_t *this = NULL; - glusterd_brickinfo_t *brickinfo = NULL; this = THIS; args.op_ret = -1; @@ -987,22 +986,6 @@ gd_syncop_mgmt_brick_op (struct rpc_clnt *rpc, glusterd_pending_node_t *pnode, else GF_FREE (args.errstr); } - if (op == GD_OP_STOP_VOLUME || op == GD_OP_REMOVE_BRICK) { - if (args.op_ret == 0) { - brickinfo = pnode->node; - ret = glusterd_brick_process_remove_brick (brickinfo); - if (ret) { - gf_msg ("glusterd", GF_LOG_ERROR, 0, - GD_MSG_BRICKPROC_REM_BRICK_FAILED, - "Removing brick %s:%s from brick" - " process failed", - brickinfo->hostname, - brickinfo->path); - args.op_ret = ret; - goto out; - } - } - } if (GD_OP_STATUS_VOLUME == op) { ret = dict_set_int32 (args.dict, "index", pnode->index); -- cgit