summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamar Shacked <tshacked@redhat.com>2020-07-21 09:31:18 +0300
committerAmar Tumballi <amar@kadalu.io>2020-07-23 10:29:26 +0000
commit850b7daf9ba1e7cd28efda3150dd8d11c61e2d27 (patch)
tree9bef8c3e1fe2692194be6a0d025cc29ffd0c4778
parentb78f17659ec15a797a20b03b2f2493b5368ad1cc (diff)
glusterd: getspec() returns wrong response when volfile not found
In a cluster env: getspec() detects that volfile not found. but further on, this return code is set by another call so the error is lost and not handled. As a result the server responds with ambiguous message: {op_ret = -1, op_errno = 0..} - which cause the client to stuck. Fix: server side: don't override the failure error. fixes: #1375 Change-Id: Id394954d4d0746570c1ee7d98969649c305c6b0d Signed-off-by: Tamar Shacked <tshacked@redhat.com>
-rw-r--r--tests/bugs/glusterd/check_elastic_server.t3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/bugs/glusterd/check_elastic_server.t b/tests/bugs/glusterd/check_elastic_server.t
index 8e9e4e5..41d2140 100644
--- a/tests/bugs/glusterd/check_elastic_server.t
+++ b/tests/bugs/glusterd/check_elastic_server.t
@@ -23,6 +23,9 @@ EXPECT 'Created' cluster_volinfo_field 1 $V0 'Status';
$CLI_1 volume start $V0
EXPECT 'Started' cluster_volinfo_field 1 $V0 'Status';
+#Mount invalid volume
+TEST ! glusterfs -s $H1 --volfile-id=$V0_NA $M0;
+
#Mount FUSE
TEST glusterfs -s $H1 --volfile-id=$V0 $M0;
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
index d1459ea..d96e355 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
@@ -1062,10 +1062,11 @@ __server_getspec(rpcsvc_request_t *req)
}
RCU_READ_UNLOCK;
if (peer_cnt) {
- ret = dict_set_str(dict, GLUSTERD_BRICK_SERVERS, peer_hosts);
- if (ret) {
+ op_ret = dict_set_str(dict, GLUSTERD_BRICK_SERVERS, peer_hosts);
+ if (op_ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
"failed to set peer_host in dict");
+ ret = op_ret;
goto fail;
}
}