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