diff options
authorAnoop C S <>2018-02-13 12:23:39 +0530
committerAnoop C S <>2018-02-19 05:46:03 +0000
commitfe8da0eb3cfb596131641ea5142e3d3d6336cba5 (patch)
parent889c363c5ea4ff5e4d76368bd99980306346fc51 (diff)
protcol/client: Insert dummy clnt-lk-version to avoid upgrade failure
With 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: 1544366 Signed-off-by: Anoop C S <> (cherry picked from commit c096bec4ec3f3ac33cc0787c60978944792e074e)
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index def95c1..74c601b 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,