summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-sm.h
diff options
context:
space:
mode:
authormohit84 <moagrawa@redhat.com>2020-11-30 17:39:53 +0530
committerGitHub <noreply@github.com>2020-11-30 13:09:53 +0100
commit12545d91eed27ff9abb0505a12c7d4e75b45a53e (patch)
tree42ec0e57bc3d9dde8748e4982c3e0d7e458013ad /xlators/mgmt/glusterd/src/glusterd-sm.h
parent0fd92465333be674485b984e54b08df3e431bb0d (diff)
downloadglusterfs-12545d91eed27ff9abb0505a12c7d4e75b45a53e.tar.gz
glusterfs-12545d91eed27ff9abb0505a12c7d4e75b45a53e.tar.xz
glusterfs-12545d91eed27ff9abb0505a12c7d4e75b45a53e.zip
glusterd[brick_mux]: Optimize friend handshake code to avoid call_bail (#1614)
During glusterd handshake glusterd received a volume dictionary from peer end to compare the own volume dictionary data.If the options are differ it sets the key to recognize volume options are changed and call import syntask to delete/start the volume.In brick_mux environment while number of volumes are high(5k) the dict api in function glusterd_compare_friend_volume takes time because the function glusterd_handle_friend_req saves all peer volume data in a single dictionary. Due to time taken by the function glusterd_handle_friend RPC requests receives a call_bail from a peer end gluster(CLI) won't be able to show volume status. Solution: To optimize the code done below changes 1) Populate a new specific dictionary to save the peer end version specific data so that function won't take much time to take the decision about the peer end has some volume updates. 2) In case of volume has differ version set the key in status_arr instead of saving in a dictionary to make the operation is faster. Note: To validate the changes followed below procedure 1) Setup 5100 distributed volumes 3x1 2) Enable brick_mux 3) Start all the volumes 4) Kill all gluster processes on 3rd node 5) Run a loop to update volume option on a 1st node for i in {1..5100}; do gluster v set vol$i performance.open-behind off; done 6) Start the glusterd process on the 3rd node 7) Wait to finish handshake and check there should not be any call_bail message in the logs Change-Id: Ibad7c23988539cc369ecc39dea2ea6985470bee1 Fixes: #1613 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-sm.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.h b/xlators/mgmt/glusterd/src/glusterd-sm.h
index 11cbd85b3e..b0aa2485f3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.h
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.h
@@ -171,6 +171,7 @@ typedef struct glusterd_friend_req_ctx_ {
rpcsvc_request_t *req;
int port;
dict_t *vols;
+ dict_t *peer_ver; // Dictionary to save peer ver data
} glusterd_friend_req_ctx_t;
typedef struct glusterd_friend_update_ctx_ {