summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2015-12-23 13:49:14 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-04-27 21:44:50 -0700
commit17ddeb5cfed4029db65d6432511ddff28c866129 (patch)
tree6732c46b567f3847fd60c61db07c62d4f04553d2 /xlators/cluster/afr/src/afr.c
parentc54be67f438c71b4cdd63eb1702acfe86e765412 (diff)
afr: propagate child up event after timeout
Backport of: http://review.gluster.org/11113 Problem: During mount, afr waits for response from all its children before notifying the parent xlator. In a 1x2 replica volume , if one of the nodes is down, the mount will hang for more than a minute until child down is received from the client xlator for that node. Fix: When parent up is received by afr, start a 10 second timer. In the timer call back, if we receive a successful child up from atleast one brick, propagate the event to the parent xlator. Change-Id: I31e57c8802c1a03a4a5d581ee4ab82f3a9c8799d BUG: 1330855 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/14088 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index ad92eaf0c3e..dafacee2996 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -498,6 +498,12 @@ fini (xlator_t *this)
afr_private_t *priv = NULL;
priv = this->private;
+ LOCK (&priv->lock);
+ if (priv->timer != NULL) {
+ gf_timer_call_cancel(this->ctx, priv->timer);
+ priv->timer = NULL;
+ }
+ UNLOCK (&priv->lock);
this->private = NULL;
afr_priv_destroy (priv);
//if (this->itable);//I dont see any destroy func