From dbbad5d69c73a62888a22adf40901e9a578c6518 Mon Sep 17 00:00:00 2001 From: mohit84 Date: Fri, 23 Apr 2021 19:26:49 +0530 Subject: glusterd: After upgrade on release 9.1 glusterd protocol is broken (#2352) * glusterd: After upgrade on release 9.1 glusterd protocol is broken After upgrade on release-9 glusterd protocol is broken because on the upgraded nodes glusterd is not able to find an actor at expected index in rpc procedure table.The new proc (GLUSTERD_MGMT_V3_POST_COMMIT) was introduced from a patch(https://review.gluster.org/#/c/glusterfs/+/24771/) in the middle due to that index of existing actor is changed on new upgraded nodes glusterd is failing. Solution: Change the proc(GLUSTERD_MGMT_V3_POST_COMMIT) position at last in proc table to avoid an issue. Fixes: #2351 Change-Id: I36575fd4302944336a75a8d4a305401a7128fd84 Signed-off-by: Mohit Agrawal --- rpc/rpc-lib/src/protocol-common.h | 3 ++- xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rpc/rpc-lib/src/protocol-common.h b/rpc/rpc-lib/src/protocol-common.h index b18eac68ee..8f4212df52 100644 --- a/rpc/rpc-lib/src/protocol-common.h +++ b/rpc/rpc-lib/src/protocol-common.h @@ -309,9 +309,10 @@ enum glusterd_mgmt_v3_procnum { GLUSTERD_MGMT_V3_PRE_VALIDATE, GLUSTERD_MGMT_V3_BRICK_OP, GLUSTERD_MGMT_V3_COMMIT, - GLUSTERD_MGMT_V3_POST_COMMIT, GLUSTERD_MGMT_V3_POST_VALIDATE, GLUSTERD_MGMT_V3_UNLOCK, + GLUSTERD_MGMT_V3_POST_COMMIT, + /* Always add new proc just before the MGMT_V3_MAXVALUE declartion */ GLUSTERD_MGMT_V3_MAXVALUE, }; diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c b/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c index 4020f38b89..89e430a255 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c @@ -1084,9 +1084,6 @@ static rpcsvc_actor_t gd_svc_mgmt_v3_actors[GLUSTERD_MGMT_V3_MAXVALUE] = { GLUSTERD_MGMT_V3_BRICK_OP, DRC_NA, 0}, [GLUSTERD_MGMT_V3_COMMIT] = {"COMMIT", glusterd_handle_commit, NULL, GLUSTERD_MGMT_V3_COMMIT, DRC_NA, 0}, - [GLUSTERD_MGMT_V3_POST_COMMIT] = {"POST_COMMIT", - glusterd_handle_post_commit, NULL, - GLUSTERD_MGMT_V3_POST_COMMIT, DRC_NA, 0}, [GLUSTERD_MGMT_V3_POST_VALIDATE] = {"POST_VAL", glusterd_handle_post_validate, NULL, GLUSTERD_MGMT_V3_POST_VALIDATE, DRC_NA, @@ -1094,6 +1091,10 @@ static rpcsvc_actor_t gd_svc_mgmt_v3_actors[GLUSTERD_MGMT_V3_MAXVALUE] = { [GLUSTERD_MGMT_V3_UNLOCK] = {"MGMT_V3_UNLOCK", glusterd_handle_mgmt_v3_unlock, NULL, GLUSTERD_MGMT_V3_UNLOCK, DRC_NA, 0}, + [GLUSTERD_MGMT_V3_POST_COMMIT] = {"POST_COMMIT", + glusterd_handle_post_commit, NULL, + GLUSTERD_MGMT_V3_POST_COMMIT, DRC_NA, 0}, + }; struct rpcsvc_program gd_svc_mgmt_v3_prog = { -- cgit