summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-09-15 01:25:51 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-15 00:34:31 -0700
commit1fc3aed7cf33b96f33693eee3c0551a0ab6a1f0f (patch)
treedef1cc2e62744c585ded8970ee864385102a3d32
parentabf28c8fd12f662f32c1a81f84620f562de8f14b (diff)
check if the peer is connected before updating friend and send response once befriended
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1601 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1601
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-sm.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd3_1-mops.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-sm.c b/xlators/mgmt/glusterd/src/glusterd-sm.c
index a38d2fd8c41..b1dc1ddac85 100644
--- a/xlators/mgmt/glusterd/src/glusterd-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-sm.c
@@ -511,7 +511,7 @@ glusterd_sm_t glusterd_state_befriended [] = {
{GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_none}, //EVENT_RCVD_LOCAL_ACC
{GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_none}, //EVENT_RCVD_RJT
{GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_none}, //EVENT_RCVD_LOCAL_RJT
- {GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_none}, //EVENT_RCV_FRIEND_REQ
+ {GD_FRIEND_STATE_BEFRIENDED, glusterd_ac_handle_friend_add_req}, //EVENT_RCV_FRIEND_REQ
{GD_FRIEND_STATE_UNFRIEND_SENT, glusterd_ac_send_friend_remove_req}, //EVENT_INIT_REMOVE_FRIEND,
{GD_FRIEND_STATE_DEFAULT, glusterd_ac_handle_friend_remove_req}, //EVENT_RCVD_REMOVE_FRIEND
{GD_FRIEND_STATE_DEFAULT, glusterd_ac_friend_remove}, //EVENT_REMOVE_FRIEND
diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
index f0d7931f97b..a9dfa6d411b 100644
--- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
+++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
@@ -888,6 +888,8 @@ glusterd3_1_friend_update (call_frame_t *frame, xlator_t *this,
uuid_copy (req.uuid, priv->uuid);
list_for_each_entry (peerinfo, &priv->peers, uuid_list) {
+ if (!peerinfo->connected)
+ continue;
dummy_frame = create_frame (this, this->ctx->pool);
ret = glusterd_submit_request (peerinfo, &req, dummy_frame,
priv->mgmt,