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 <anoopcs@redhat.com>
This commit is contained in:
Anoop C S 2018-02-13 12:23:39 +05:30 committed by Amar Tumballi
parent 7a4ca270af
commit c096bec4ec

View File

@ -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,