From c096bec4ec3f3ac33cc0787c60978944792e074e Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Tue, 13 Feb 2018 12:23:39 +0530 Subject: protcol/client: Insert dummy clnt-lk-version to avoid upgrade failure With https://review.gluster.org/#/c/12363/ being merged, we no longer send client's lk-version to server side and the corresponding check on server is also removed. But when clients are upgraded prior to servers, the check for lk-version at server side fails and is reported back to clients resulting in disconnection. Since we don't have lock-recovery (lk-version and grace-timeout) logic anymore in code base our best bet would be to add client's default lk-version i.e, 1, into the dictionary just to make server side check pass and continue with remaining SETVOLUME operations. Change-Id: I441b67bd271d1e9ba9a7c08703e651c7a6bd945b BUG: 1544699 Signed-off-by: Anoop C S --- xlators/protocol/client/src/client-handshake.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/protocol/client/src') diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index def95c15cf9..74c601bbcbd 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -1341,6 +1341,15 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc) } } + /* Insert a dummy key value pair to avoid failure at server side for + * clnt-lk-version with new clients. + */ + ret = dict_set_uint32 (options, "clnt-lk-version", 1); + if (ret < 0) { + gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED, + "failed to set clnt-lk-version(1) in handshake msg"); + } + ret = dict_set_int32 (options, "opversion", GD_OP_VERSION_MAX); if (ret < 0) { gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED, -- cgit