protocol/server: Insert dummy clnt-lk-version to avoid upgrade failure

This is required as we check for 'clnt-lk-version' in SETVOLUME callback
with older clients in place against newer servers. Change is similar to
what we have done via https://review.gluster.org/#/c/19560/.

Change-Id: If333c20cf9503f40687ec926c44c7e50222c05b5
BUG: 1544699
Signed-off-by: Anoop C S <anoopcs@redhat.com>
This commit is contained in:
Anoop C S 2018-03-02 10:32:17 +05:30 committed by Shyamsundar Ranganathan
parent fc35d400cb
commit fecb0fc748

View File

@ -838,6 +838,16 @@ server_setvolume (rpcsvc_request_t *req)
if (ret)
gf_msg_debug (this->name, 0, "failed to set 'process-uuid'");
/* Insert a dummy key value pair to avoid failure at client side for
* clnt-lk-version with older clients.
*/
ret = dict_set_uint32 (reply, "clnt-lk-version", 0);
if (ret) {
gf_msg (this->name, GF_LOG_WARNING, 0,
PS_MSG_CLIENT_LK_VERSION_ERROR, "failed to set "
"'clnt-lk-version'");
}
ret = dict_set_uint64 (reply, "transport-ptr",
((uint64_t) (long) req->trans));
if (ret)