summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2010-08-27 03:57:53 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-08-27 05:53:55 -0700
commit07873893ad88e961cd0736872700f2bdc746d49c (patch)
tree94deae6e798fb0e475c9e9c88837132e3a2efe75 /xlators
parentc97156833355697a381e5e6a1c14142d8c9f3593 (diff)
Misleading probe message for friend
Progress with probe if host already is present in the list and state is not default or request received. To test, probe from on host, on the other host, do a probe back to host1. This should now continue with probe for the first time. Second probe should return already friend msg. Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 6c99ae70b..9eefd89b4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -530,11 +530,15 @@ glusterd_handle_cli_probe (rpcsvc_request_t *req)
}
if (!(ret = glusterd_friend_find_by_hostname(cli_req.hostname,
&peerinfo))) {
- gf_log ("glusterd", GF_LOG_NORMAL, "Probe host %s port %d"
- "already a friend", cli_req.hostname, cli_req.port);
- glusterd_xfer_cli_probe_resp (req, 0, GF_PROBE_FRIEND,
- cli_req.hostname, cli_req.port);
- goto out;
+ if ((peerinfo->state.state != GD_FRIEND_STATE_REQ_RCVD)
+ || (peerinfo->state.state != GD_FRIEND_STATE_DEFAULT)) {
+
+ gf_log ("glusterd", GF_LOG_NORMAL, "Probe host %s port %d"
+ "already a friend", cli_req.hostname, cli_req.port);
+ glusterd_xfer_cli_probe_resp (req, 0, GF_PROBE_FRIEND,
+ cli_req.hostname, cli_req.port);
+ goto out;
+ }
}
ret = glusterd_probe_begin (req, cli_req.hostname, cli_req.port);