summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-05-09 21:05:50 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-05-14 21:10:29 +0000
commit86ad032949cb80b6ba3df9dc8268243529d4eb84 (patch)
treebbf502850ccadd077257dde2664c55a9ae8ca054 /glusterfsd
parent269e2ccf45ddc662d8373eb887ae6cef96e2ef37 (diff)
glusterfsd: send PARENT_UP on brick attach
With brick multiplexing being enabled, if a brick is instance attached to a process then a PARENT_UP event is needed so that it reaches right till posix layer and then from posix CHILD_UP event is sent back to all the children. Change-Id: Ic341086adb3bbbde0342af518e1b273dd2f669b9 BUG: 1447389 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/17225 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 9b76c7576d4..a22568c3323 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -827,6 +827,7 @@ glusterfs_handle_attach (rpcsvc_request_t *req)
int32_t ret = -1;
gd1_mgmt_brick_op_req xlator_req = {0,};
xlator_t *this = NULL;
+ glusterfs_graph_t *newgraph = NULL;
GF_ASSERT (req);
this = THIS;
@@ -840,13 +841,22 @@ glusterfs_handle_attach (rpcsvc_request_t *req)
req->rpc_err = GARBAGE_ARGS;
return -1;
}
+ ret = 0;
if (this->ctx->active) {
gf_log (this->name, GF_LOG_INFO,
"got attach for %s", xlator_req.name);
ret = glusterfs_graph_attach (this->ctx->active,
- xlator_req.name);
+ xlator_req.name, &newgraph);
if (ret == 0) {
+ ret = glusterfs_graph_parent_up (newgraph);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ LG_MSG_EVENT_NOTIFY_FAILED,
+ "Parent up notification "
+ "failed");
+ goto out;
+ }
glusterfs_autoscale_threads (this->ctx, 1);
}
} else {
@@ -857,10 +867,11 @@ glusterfs_handle_attach (rpcsvc_request_t *req)
glusterfs_translator_info_response_send (req, ret, NULL, NULL);
+out:
free (xlator_req.input.input_val);
free (xlator_req.name);
- return 0;
+ return ret;
}
int