From 15d1f5b80b1eeb9c8f7d85c72247ffc4ef704267 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Fri, 9 Nov 2018 12:44:20 +0530 Subject: [PATCH 445/450] 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 upstream patch: https://review.gluster.org/#/c/glusterfs/+/21608/ Change-Id: Ic6a133d77113c992a4dbeaf7f5663b7ffcbb0ae9 BUG: 1648210 Signed-off-by: Sanju Rakonde Reviewed-on: https://code.engineering.redhat.com/gerrit/156190 Tested-by: RHGS Build Bot Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 716d3f2..8d767cc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -2622,6 +2622,7 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict, glusterd_volinfo_t *volinfo = NULL; glusterd_svc_t *svc = NULL; gf_boolean_t start_nfs_svc = _gf_false; + gf_boolean_t svcs_reconfigure = _gf_false; conf = this->private; ret = dict_get_str (dict, "key1", &key); @@ -2717,15 +2718,16 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict, } 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; } } if (start_nfs_svc) { @@ -2758,7 +2760,6 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict, ret = dict_set_str (dup_opt, key, value); if (ret) goto out; - ret = glusterd_get_next_global_opt_version_str (conf->opts, &next_version); if (ret) -- 1.8.3.1