From 10fa1bcce3b73f630dbc3241722c1af9dee4c414 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Mon, 27 Jun 2016 12:40:17 +0530 Subject: protocol/server: Fix client/server compatibility The 3.8 client expects a child_up key from the server indicating the status of the server translators. This key is not being sent by the servers running older versions, thereby breaking compatibility. With this patch we are treating the absence of the said key as an indication that the server trying to connect to this client is running an older version and hence in such a case we are setting conf->child_up as _gf_true explicitly. This should suffice in emulating the older behavior. Due to the nature of this bug, requiring two version to be reproducible, there are no testcases added for the same. Change-Id: I29e0a5c63b55380dc9db8e42852d7e95b64a2b2e BUG: 1350327 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/14811 Reviewed-by: Raghavendra G CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Smoke: Gluster Build System Tested-by: Gluster Build System --- xlators/protocol/client/src/client-handshake.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 5352e549abf..3284facb893 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -1172,9 +1172,14 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m ret = dict_get_uint32 (reply, "child_up", &conf->child_up); if (ret) { + /* + * This would happen in cases where the server trying to * + * connect to this client is running an older version. Hence * + * setting the child_up to _gf_true in this case. * + */ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_GET_FAILED, "failed to find key 'child_up' in the options"); - goto out; + conf->child_up = _gf_true; } ret = dict_get_uint32 (reply, "clnt-lk-version", &lk_ver); -- cgit