74b1de
From 321080e55f0ae97115a9542ba5de8494e7610860 Mon Sep 17 00:00:00 2001
74b1de
From: Mohammed Rafi KC <rkavunga@redhat.com>
74b1de
Date: Tue, 14 May 2019 23:12:44 +0530
74b1de
Subject: [PATCH 167/169] glusterd/shd: Optimize the glustershd manager to send
74b1de
 reconfigure
74b1de
74b1de
Traditionally all svc manager will execute process stop and then
74b1de
followed by start each time when they called. But that is not
74b1de
required by shd, because the attach request implemented in the shd
74b1de
multiplex has the intelligence to check whether a detach is required
74b1de
prior to attaching the graph. So there is no need to send an explicit
74b1de
detach request if we are sure that the next call is an attach request
74b1de
74b1de
Upstream patch: https://review.gluster.org/#/c/glusterfs/+/22729/
74b1de
>Change-Id: I9157c8dcaffdac038f73286bcf5646a3f1d3d8ec
74b1de
>fixes: bz#1710054
74b1de
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
74b1de
74b1de
Change-Id: I56aaaf3b4d28215307e160c1ba0e09bb74c30fbe
74b1de
BUG: 1716865
74b1de
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
74b1de
Reviewed-on: https://code.engineering.redhat.com/gerrit/172289
74b1de
Tested-by: RHGS Build Bot <nigelb@redhat.com>
74b1de
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
74b1de
---
74b1de
 libglusterfs/src/graph.c                     | 1 -
74b1de
 xlators/mgmt/glusterd/src/glusterd-shd-svc.c | 9 +++++----
74b1de
 2 files changed, 5 insertions(+), 5 deletions(-)
74b1de
74b1de
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
74b1de
index 18fb2d9..27d9335 100644
74b1de
--- a/libglusterfs/src/graph.c
74b1de
+++ b/libglusterfs/src/graph.c
74b1de
@@ -1497,7 +1497,6 @@ glusterfs_process_svc_detach(glusterfs_ctx_t *ctx, gf_volfile_t *volfile_obj)
74b1de
         parent_graph->last_xl = glusterfs_get_last_xlator(parent_graph);
74b1de
         parent_graph->xl_count -= graph->xl_count;
74b1de
         parent_graph->leaf_count -= graph->leaf_count;
74b1de
-        default_notify(xl, GF_EVENT_PARENT_DOWN, xl);
74b1de
         parent_graph->id++;
74b1de
         ret = 0;
74b1de
     }
74b1de
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
74b1de
index 981cc87..d81d760 100644
74b1de
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
74b1de
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
74b1de
@@ -311,10 +311,11 @@ glusterd_shdsvc_manager(glusterd_svc_t *svc, void *data, int flags)
74b1de
          */
74b1de
         ret = svc->stop(svc, SIGTERM);
74b1de
     } else if (volinfo) {
74b1de
-        ret = svc->stop(svc, SIGTERM);
74b1de
-        if (ret)
74b1de
-            goto out;
74b1de
-
74b1de
+        if (volinfo->status != GLUSTERD_STATUS_STARTED) {
74b1de
+            ret = svc->stop(svc, SIGTERM);
74b1de
+            if (ret)
74b1de
+                goto out;
74b1de
+        }
74b1de
         if (volinfo->status == GLUSTERD_STATUS_STARTED) {
74b1de
             ret = svc->start(svc, flags);
74b1de
             if (ret)
74b1de
-- 
74b1de
1.8.3.1
74b1de