summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2015-10-16 06:23:29 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-10-20 01:44:36 -0700
commit7945121dda340ec8f25711b2ad3ca70b544de967 (patch)
tree7449e14f04ede728b9929e9bd6b6d53a386d3406 /xlators
parentcddc75e242140f8485e2377ce4e6dffe23123744 (diff)
afr: do not wind write if pre-op fails on all children
1. When winding the pre-op, transaction.pre_op[i] is set. If the pre-op fails, transaction.failed_subvols[i] is set. If if fails on all chidren, we can directly proceed to unlock (via afr_changelog_post_op_now) without trying to wind the write, fail and then go to unlock. 2. 'fop_subvols' seems to be an unused variable, hence removing it. Change-Id: I9525628daf48082e979b0093fa0478934495e61f BUG: 1272362 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/12368 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Anuradha Talur <atalur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr-common.c7
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c6
-rw-r--r--xlators/cluster/afr/src/afr.h7
3 files changed, 7 insertions, 13 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index ce9c1ce110a..576199db137 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1199,7 +1199,6 @@ afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this)
}
GF_FREE (local->transaction.eager_lock);
- GF_FREE (local->transaction.fop_subvols);
GF_FREE (local->transaction.failed_subvols);
GF_FREE (local->transaction.basename);
@@ -4171,12 +4170,6 @@ afr_transaction_local_init (afr_local_t *local, xlator_t *this)
goto out;
}
- local->transaction.fop_subvols = GF_CALLOC (sizeof (*local->transaction.fop_subvols),
- priv->child_count,
- gf_afr_mt_char);
- if (!local->transaction.fop_subvols)
- goto out;
-
local->transaction.failed_subvols = GF_CALLOC (sizeof (*local->transaction.failed_subvols),
priv->child_count,
gf_afr_mt_char);
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 915b68ef07d..81d5deeb019 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -44,12 +44,16 @@ __afr_txn_write_fop (call_frame_t *frame, xlator_t *this)
afr_local_t *local = NULL;
afr_private_t *priv = NULL;
int call_count = -1;
+ unsigned char *failed_subvols = NULL;
int i = 0;
local = frame->local;
priv = this->private;
- call_count = AFR_COUNT (local->transaction.pre_op, priv->child_count);
+ failed_subvols = local->transaction.failed_subvols;
+
+ call_count = priv->child_count - AFR_COUNT (failed_subvols,
+ priv->child_count);
if (call_count == 0) {
local->transaction.resume (frame, this);
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 85a8ec676cb..bd4ff655546 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -657,11 +657,8 @@ typedef struct _afr_local {
dict_t **pre_op_xdata;
unsigned char *pre_op_sources;
- /* @fop_subvols: subvolumes on which FOP will be attempted */
- unsigned char *fop_subvols;
-
- /* @failed_subvols: subvolumes on which FOP failed. Always
- a subset of @fop_subvols */
+ /* @failed_subvols: subvolumes on which a pre-op or a
+ FOP failed. */
unsigned char *failed_subvols;
/* @dirtied: flag which indicates whether we set dirty flag