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