summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-12-08 22:49:48 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-12-13 01:03:15 -0800
commitd1cb82ef4154c52c8c9b7a95c5016b97d9babf10 (patch)
treea913100e2d82cc0e1da3e54af9fee3f81eb55dd0 /xlators/cluster/afr/src/afr-common.c
parent1d66eb4af160dfa6350410cd6d03e4aa1caf1c53 (diff)
cluster/afr: Fix per-txn optimistic changelog initialisation
Backport of: http://review.gluster.org/16075 Incorrect initialisation of local->optimistic_change_log was leading to skipped pre-op and post-op even when a brick didn't participate in the txn because it was down. The result - missing granular name index resulting in some entries never getting healed. FIX: Initialise local->optimistic_change_log just before pre-op. Also fixed granular entry heal to create the granular name index in pre-op as opposed to post-op. This is to prevent loss of granular information when during an entry txn, the good (src) brick goes offline before the post-op is done. This would cause self-heal to do conservative merge (since dirty xattr is the only information available), which when granular-entry-heal is enabled, expects granular indices, the lack of which can lead to loss of data in the worst case. Change-Id: Ibc0fbfb3fa21c578e28868d9e30b274e33c12064 BUG: 1403646 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/16105 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 95c363cea69..59aec7afca1 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -4557,7 +4557,6 @@ out:
int
afr_transaction_local_init (afr_local_t *local, xlator_t *this)
{
- int child_up_count = 0;
int ret = -ENOMEM;
afr_private_t *priv = NULL;
@@ -4576,10 +4575,6 @@ afr_transaction_local_init (afr_local_t *local, xlator_t *this)
}
ret = -ENOMEM;
- child_up_count = AFR_COUNT (local->child_up, priv->child_count);
- if (priv->optimistic_change_log && child_up_count == priv->child_count)
- local->optimistic_change_log = 1;
-
local->pre_op_compat = priv->pre_op_compat;
local->transaction.eager_lock =