summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorGaurav Kumar Garg <garg.gaurav52@gmail.com>2015-08-11 18:17:31 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-03-22 00:06:10 -0700
commit2512bb829a10d9d087a0c7d2a4217b90b60e3845 (patch)
tree505b4815bd9267ea87e693179c25516238a044bc /xlators/mgmt
parent8b3dd6a7841755816ac15cb206602efb07c3c102 (diff)
glusterd: probing a new node, which is part of another cluster should give error
This patch is backport of: http://review.gluster.org/#/c/11884/ If user try to add node to extant cluster using "gluster peer probe \ <ip/hostname>" command then command is failing but its not giving proper cause of failure. This fix will take control of proper error message during peer probe with already extant cluster. Change-Id: I4f993e78c0e1b3e061153b984ec5e9b70085aef5 BUG: 1317861 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> >> Change-Id: I4f993e78c0e1b3e061153b984ec5e9b70085aef5 >> BUG: 1252448 >> Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> >> Reviewed-on: http://review.gluster.org/11884 >> Tested-by: NetBSD Build System <jenkins@build.gluster.org> >> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> (cherry picked from commit 31a36dca20a976b143cc5c970e115d8d36df847a) Change-Id: I0066d8b3b70346b123ab5f3b32a6cf8e54d242fc Reviewed-on: http://review.gluster.org/13741 Tested-by: Gaurav Kumar Garg <ggarg@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 99e71953f63..410dd4478ca 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -5058,7 +5058,7 @@ glusterd_brick_rpc_notify (struct rpc_clnt *rpc, void *mydata,
}
int
-glusterd_friend_remove_notify (glusterd_peerctx_t *peerctx)
+glusterd_friend_remove_notify (glusterd_peerctx_t *peerctx, int32_t op_errno)
{
int ret = -1;
glusterd_friend_sm_event_t *new_event = NULL;
@@ -5094,7 +5094,7 @@ glusterd_friend_remove_notify (glusterd_peerctx_t *peerctx)
goto out;
}
- glusterd_xfer_cli_probe_resp (req, -1, ENOTCONN, errstr,
+ glusterd_xfer_cli_probe_resp (req, -1, op_errno, errstr,
peerinfo->hostname,
peerinfo->port, dict);
@@ -5121,6 +5121,7 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
int ret = 0;
+ int32_t op_errno = ENOTCONN;
glusterd_peerinfo_t *peerinfo = NULL;
glusterd_peerctx_t *peerctx = NULL;
gf_boolean_t quorum_action = _gf_false;
@@ -5213,6 +5214,7 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
}
}
+ op_errno = GF_PROBE_ANOTHER_CLUSTER;
ret = 0;
}
@@ -5227,7 +5229,7 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
* fails, and notify cli. Happens only during probe.
*/
if (peerinfo->state.state == GD_FRIEND_STATE_DEFAULT) {
- glusterd_friend_remove_notify (peerctx);
+ glusterd_friend_remove_notify (peerctx, op_errno);
goto out;
}