summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-01-14 23:59:30 +0000
committerAvra Sengupta <asengupt@redhat.com>2014-01-21 01:50:03 +0000
commitb9ef2f7fed24af01c4590c6f90dec93ef21b9f0b (patch)
tree80da1256705b99799c51385ea7dcb9f601d86bdd /xlators
parenta3387fe696dabef8b53d8b790743598d5441e06b (diff)
glusterd/vol-locks: Releasing vol-locks on receiving peer disconnect
On receiving peer disconnect, release volume locks held by the disconnected peer Change-Id: I0e36ba2fba4761225092ce2fb7b9b3c2d2dca0ad Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 259b82a81..a95989cc9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -4034,6 +4034,7 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
glusterd_peerinfo_t *peerinfo = NULL;
glusterd_peerctx_t *peerctx = NULL;
gf_boolean_t quorum_action = _gf_false;
+ glusterd_volinfo_t *volinfo = NULL;
peerctx = mydata;
if (!peerctx)
@@ -4061,6 +4062,19 @@ __glusterd_peer_rpc_notify (struct rpc_clnt *rpc, void *mydata,
gf_log (this->name, GF_LOG_DEBUG, "got RPC_CLNT_DISCONNECT %d",
peerinfo->state.state);
+ if (peerinfo->connected) {
+ list_for_each_entry (volinfo, &conf->volumes, vol_list) {
+ ret = glusterd_volume_unlock (volinfo->volname,
+ peerinfo->uuid);
+ if (ret)
+ gf_log (this->name, GF_LOG_TRACE,
+ "Lock not released for %s",
+ volinfo->volname);
+ }
+
+ ret = 0;
+ }
+
if ((peerinfo->quorum_contrib != QUORUM_DOWN) &&
(peerinfo->state.state == GD_FRIEND_STATE_BEFRIENDED)) {
peerinfo->quorum_contrib = QUORUM_DOWN;