summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-12-08 09:58:27 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-12-08 08:45:31 -0800
commit353fb2e97bfc3a44cc5301fa8dfb015406565048 (patch)
tree568b0aeeffc5e10c4fab680f5aefd8fa31fc51da /xlators/cluster/afr/src/afr.c
parent147b20c4a485ddb4b31b1811be4bf90610c91f7f (diff)
replicate: propagate CHILD_DOWN upwards properly
During initialization if one subvolume returns CHILD_DOWN, then do not consider the other subvolume as down if we still haven't heard from it yet This causes DHT (on top) to prematurely (and wrongly) send CHILD_UP/DOWN upwards Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2200 (cp dies with "Invalid argument" after failover) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2200
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index f1b163f0b58..5f586e20124 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -874,6 +874,13 @@ init (xlator_t *this)
goto out;
}
+ for (i = 0; i < child_count; i++)
+ priv->child_up[i] = -1; /* start with unknown state.
+ this initialization needed
+ for afr_notify() to work
+ reliably
+ */
+
priv->children = GF_CALLOC (sizeof (xlator_t *), child_count,
gf_afr_mt_xlator_t);
if (!priv->children) {