d1681e
From bab10010daf3dc93492e7770e4084f0f422e3b0c Mon Sep 17 00:00:00 2001
d1681e
From: Atin Mukherjee <amukherj@redhat.com>
d1681e
Date: Mon, 29 Jan 2018 10:23:52 +0530
d1681e
Subject: [PATCH 145/148] glusterd: optimize glusterd import volumes code path
d1681e
d1681e
In case there's a version mismatch detected for one of the volumes
d1681e
glusterd was ending up with updating all the volumes which is a
d1681e
overkill.
d1681e
d1681e
>upstream mainline patch : https://review.gluster.org/#/c/19358/
d1681e
d1681e
Change-Id: I6df792db391ce3a1697cfa9260f7dbc3f59aa62d
d1681e
BUG: 1540600
d1681e
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/129935
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
d1681e
---
d1681e
 xlators/mgmt/glusterd/src/glusterd-utils.c | 12 +++++++-----
d1681e
 1 file changed, 7 insertions(+), 5 deletions(-)
d1681e
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
d1681e
index 4bb54db..d991a9f 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
d1681e
@@ -4819,16 +4819,18 @@ glusterd_compare_friend_data (dict_t *peer_data, int32_t *status,
d1681e
                         ret = 0;
d1681e
                         goto out;
d1681e
                 }
d1681e
-                if (GLUSTERD_VOL_COMP_UPDATE_REQ == *status)
d1681e
+                if (GLUSTERD_VOL_COMP_UPDATE_REQ == *status) {
d1681e
+                        ret = glusterd_import_friend_volume (peer_data, i);
d1681e
+                        if (ret) {
d1681e
+                                goto out;
d1681e
+                        }
d1681e
                         update = _gf_true;
d1681e
-
d1681e
+                        *status = GLUSTERD_VOL_COMP_NONE;
d1681e
+                }
d1681e
                 i++;
d1681e
         }
d1681e
 
d1681e
         if (update) {
d1681e
-                ret = glusterd_import_friend_volumes (peer_data);
d1681e
-                if (ret)
d1681e
-                        goto out;
d1681e
                 glusterd_svcs_manager (NULL);
d1681e
         }
d1681e
 
d1681e
-- 
d1681e
1.8.3.1
d1681e