summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-08-05 12:18:05 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-08-17 03:22:53 -0700
commite65e066c4f993aac626112e718ee66d35d15c6a8 (patch)
treeac4f01a5ffc14ec0fac0496f30e19b4b497156f2
parent0215d1df7cedf7ca54cf96d2a09a68b294cf9459 (diff)
cluster/afr: Bug fixes in txn codepath
Backport of: http://review.gluster.org/15145 AFR sets transaction.pre_op[] array even before actually doing the pre-op on-disk. Therefore, AFR must not only consider the pre_op[] array but also the failed_subvols[] information before setting the pre_op_done[] flag. This patch fixes that. Change-Id: I8163256a6de254be43a7a526c6d2f9dc30e0e1df BUG: 1367270 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/15162 Reviewed-by: Ravishankar N <ravishankar@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Anuradha Talur <atalur@redhat.com>
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index a20be30d3ca..155cf5fe1ec 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -1060,11 +1060,11 @@ afr_changelog_pre_op_update (call_frame_t *frame, xlator_t *this)
if (!fd_ctx->on_disk[type]) {
for (i = 0; i < priv->child_count; i++)
fd_ctx->pre_op_done[type][i] =
- local->transaction.pre_op[i];
+ (!local->transaction.failed_subvols[i]);
} else {
for (i = 0; i < priv->child_count; i++)
if (fd_ctx->pre_op_done[type][i] !=
- local->transaction.pre_op[i]) {
+ (!local->transaction.failed_subvols[i])) {
local->transaction.no_uninherit = 1;
goto unlock;
}