summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2018-06-29 11:30:37 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-07-02 10:10:19 +0000
commit2f9e555f79ce69668950693ed2e09cfafd2b7ec1 (patch)
tree81f5505507bb6ae6841c4f5cbfae9f7783e5be44 /glusterfsd
parent957e2963cfd960caa49edc0e6aba738167b33ec5 (diff)
glusterfsd: Do not process GLUSTERD_BRICK_XLATOR_OP if graph is not ready
Problem: If glustershd gets restarted by glusterd due to node reboot/volume start force/ or any thing that changes shd graph (add/remove brick), and index heal is launched via CLI, there can be a chance that shd receives this IPC before the graph is fully active. Thus when it accesses glusterfsd_ctx->active, it crashes. Fix: Since glusterd does not really wait for the daemons it spawned to be fully initialized and can send the request as soon as rpc initialization has succeeded, we just handle it at shd. If glusterfs_graph_activate() is not yet done in shd but glusterd sends GD_OP_HEAL_VOLUME to shd, we fail the request. Change-Id: If6cc07bc5455c4ba03458a36c28b63664496b17d fixes: bz#1596513 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd-messages.h3
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd-messages.h b/glusterfsd/src/glusterfsd-messages.h
index 8df32a33179..95fc79ef8d0 100644
--- a/glusterfsd/src/glusterfsd-messages.h
+++ b/glusterfsd/src/glusterfsd-messages.h
@@ -60,7 +60,8 @@ GLFS_MSGID(GLUSTERFSD,
glusterfsd_msg_34,
glusterfsd_msg_35,
glusterfsd_msg_36,
- glusterfsd_msg_37
+ glusterfsd_msg_37,
+ glusterfsd_msg_38
);
#endif /* !_GLUSTERFSD_MESSAGES_H_ */
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 863765d644f..7122fc0d127 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -681,6 +681,13 @@ glusterfs_handle_translator_op (rpcsvc_request_t *req)
ctx = glusterfsd_ctx;
active = ctx->active;
+ if (!active) {
+ ret = -1;
+ gf_msg (this->name, GF_LOG_ERROR, EAGAIN, glusterfsd_msg_38,
+ "Not processing brick-op no. %d since volume graph is "
+ "not yet active.", xlator_req.op);
+ goto out;
+ }
any = active->first;
input = dict_new ();
ret = dict_unserialize (xlator_req.input.input_val,