summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2019-05-14 23:12:44 +0530
committermohammed rafi kc <rkavunga@redhat.com>2019-05-31 12:17:48 +0000
commitc848f7163c5ba6b8a081c0f07a4776f7ff8dfca0 (patch)
tree1bcceb229ec601adcf8e40eb298d7c0e099a7ba3 /xlators/mgmt/glusterd
parente510f55bed6c26c6b995e7d9f3c35e1e4e482769 (diff)
glusterd/shd: Optimize the glustershd manager to send reconfigure
Traditionally all svc manager will execute process stop and then followed by start each time when they called. But that is not required by shd, because the attach request implemented in the shd multiplex has the intelligence to check whether a detach is required prior to attaching the graph. So there is no need to send an explicit detach request if we are sure that the next call is an attach request Change-Id: I9157c8dcaffdac038f73286bcf5646a3f1d3d8ec fixes: bz#1710054 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-shd-svc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
index ce68a0f07c3..ebf7e3a8e6b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
@@ -311,10 +311,11 @@ glusterd_shdsvc_manager(glusterd_svc_t *svc, void *data, int flags)
*/
ret = svc->stop(svc, SIGTERM);
} else if (volinfo) {
- ret = svc->stop(svc, SIGTERM);
- if (ret)
- goto out;
-
+ if (volinfo->status != GLUSTERD_STATUS_STARTED) {
+ ret = svc->stop(svc, SIGTERM);
+ if (ret)
+ goto out;
+ }
if (volinfo->status == GLUSTERD_STATUS_STARTED) {
ret = svc->start(svc, flags);
if (ret)