From 9ce088e947d0867ded1bd969d9b22624a59f178b Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Fri, 9 Nov 2018 12:44:20 +0530 Subject: glusterd: don't call svcs_reconfigure for all volumes during op-version bump up With having large number of volumes in a configuration having svcs_reconfigure () called for every volumes makes cluster.op-version bump up to time out. Instead call svcs_reconfigure () only once. Change-Id: Ic6a133d77113c992a4dbeaf7f5663b7ffcbb0ae9 Fixes: bz#1648237 Signed-off-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 3ccc9a3c776..e72bec4e55c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -2568,6 +2568,7 @@ glusterd_op_set_all_volume_options(xlator_t *this, dict_t *dict, uint32_t op_version = 0; glusterd_volinfo_t *volinfo = NULL; glusterd_svc_t *svc = NULL; + gf_boolean_t svcs_reconfigure = _gf_false; conf = this->private; ret = dict_get_strn(dict, "key1", SLEN("key1"), &key); @@ -2668,16 +2669,19 @@ glusterd_op_set_all_volume_options(xlator_t *this, dict_t *dict, goto out; } if (GLUSTERD_STATUS_STARTED == volinfo->status) { - ret = glusterd_svcs_reconfigure(); - if (ret) { - gf_msg(this->name, GF_LOG_ERROR, 0, - GD_MSG_SVC_RESTART_FAIL, - "Unable to restart " - "services"); - goto out; - } + svcs_reconfigure = _gf_true; } } + if (svcs_reconfigure) { + ret = glusterd_svcs_reconfigure(); + if (ret) { + gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SVC_RESTART_FAIL, + "Unable to restart " + "services"); + goto out; + } + } + ret = glusterd_store_global_info(this); if (ret) { gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_OP_VERS_STORE_FAIL, -- cgit