887953
From 15d1f5b80b1eeb9c8f7d85c72247ffc4ef704267 Mon Sep 17 00:00:00 2001
887953
From: Atin Mukherjee <amukherj@redhat.com>
887953
Date: Fri, 9 Nov 2018 12:44:20 +0530
887953
Subject: [PATCH 445/450] glusterd: don't call svcs_reconfigure for all volumes
887953
 during op-version bump up
887953
887953
With having large number of volumes in a configuration having
887953
svcs_reconfigure () called for every volumes makes cluster.op-version bump up to
887953
time out. Instead call svcs_reconfigure () only once.
887953
887953
> Change-Id: Ic6a133d77113c992a4dbeaf7f5663b7ffcbb0ae9
887953
> Fixes: bz#1648237
887953
> Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
887953
887953
upstream patch: https://review.gluster.org/#/c/glusterfs/+/21608/
887953
887953
Change-Id: Ic6a133d77113c992a4dbeaf7f5663b7ffcbb0ae9
887953
BUG: 1648210
887953
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/156190
887953
Tested-by: RHGS Build Bot <nigelb@redhat.com>
887953
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
887953
---
887953
 xlators/mgmt/glusterd/src/glusterd-op-sm.c | 21 +++++++++++----------
887953
 1 file changed, 11 insertions(+), 10 deletions(-)
887953
887953
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
887953
index 716d3f2..8d767cc 100644
887953
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
887953
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
887953
@@ -2622,6 +2622,7 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
887953
         glusterd_volinfo_t  *volinfo                = NULL;
887953
         glusterd_svc_t      *svc                    = NULL;
887953
         gf_boolean_t         start_nfs_svc          = _gf_false;
887953
+        gf_boolean_t         svcs_reconfigure       = _gf_false;
887953
 
887953
         conf = this->private;
887953
         ret = dict_get_str (dict, "key1", &key);
887953
@@ -2717,15 +2718,16 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
887953
                                 }
887953
                                 if (GLUSTERD_STATUS_STARTED
887953
                                                  == volinfo->status) {
887953
-                                        ret = glusterd_svcs_reconfigure ();
887953
-                                        if (ret) {
887953
-                                                gf_msg (this->name,
887953
-                                                        GF_LOG_ERROR, 0,
887953
-                                                        GD_MSG_SVC_RESTART_FAIL,
887953
-                                                        "Unable to restart "
887953
-                                                        "services");
887953
-                                                goto out;
887953
-                                        }
887953
+                                        svcs_reconfigure = _gf_true;
887953
+                                }
887953
+                        }
887953
+                        if (svcs_reconfigure) {
887953
+                                ret = glusterd_svcs_reconfigure();
887953
+                                if (ret) {
887953
+                                        gf_msg (this->name, GF_LOG_ERROR, 0,
887953
+                                                GD_MSG_SVC_RESTART_FAIL,
887953
+                                                "Unable to restart services");
887953
+                                        goto out;
887953
                                 }
887953
                         }
887953
                         if (start_nfs_svc) {
887953
@@ -2758,7 +2760,6 @@ glusterd_op_set_all_volume_options (xlator_t *this, dict_t *dict,
887953
         ret = dict_set_str (dup_opt, key, value);
887953
         if (ret)
887953
                 goto out;
887953
-
887953
         ret = glusterd_get_next_global_opt_version_str (conf->opts,
887953
                                                         &next_version);
887953
         if (ret)
887953
-- 
887953
1.8.3.1
887953