diff options
author | Sanju Rakonde <srakonde@redhat.com> | 2018-02-21 12:46:25 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2018-03-28 04:27:18 +0000 |
commit | a60fc2ddc03134fb23c5ed5c0bcb195e1649416b (patch) | |
tree | c4f42085b4c6c6761bf4f3d23a24b8821cf292a8 /xlators/mgmt/glusterd/src/glusterd-pmap.c | |
parent | 95601229b8318f015a19d7eff89f73853b684a49 (diff) |
glusterd: handling brick termination in brick-mux
Problem: There's a race between the last glusterfs_handle_terminate()
response sent to glusterd and the kill that happens immediately if the
terminated brick is the last brick.
Solution: When it is a last brick for the brick process, instead of glusterfsd
killing itself, glusterd will kill the process in case of brick multiplexing.
And also changing gf_attach utility accordingly.
Change-Id: I386c19ca592536daa71294a13d9fc89a26d7e8c0
fixes: bz#1545048
BUG: 1545048
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-pmap.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-pmap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c index 98b1aaa63af..8ef285bf48d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-pmap.c +++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c @@ -557,6 +557,7 @@ __gluster_pmap_signout (rpcsvc_request_t *req) glusterd_brickinfo_t *brickinfo = NULL; char pidfile[PATH_MAX] = {0}; char brick_path[PATH_MAX] = {0,}; + int kill_pid = -1; this = THIS; GF_VALIDATE_OR_GOTO ("glusterd", this, fail); @@ -606,7 +607,8 @@ __gluster_pmap_signout (rpcsvc_request_t *req) * removed in the brick op phase. This situation would * arise when the brick is killed explicitly from the * backend */ - ret = glusterd_brick_process_remove_brick (brickinfo); + ret = glusterd_brick_process_remove_brick (brickinfo, + &kill_pid); if (ret) { gf_msg_debug (this->name, 0, "Couldn't remove " "brick %s:%s from brick process", |