From da9f8bd6e9421209243afeabbad350cc1d70fdc5 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Mon, 26 Oct 2015 14:14:18 +0530 Subject: afr: fixes in transaction code Backport of http://review.gluster.org/#/c/12368/ and http://review.gluster.org/#/c/12415/ 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 going to unlock. 2. 'fop_subvols' seems to be an unused variable, hence removing it. 3. Call local->transaction.wind() only on subvols where pre-op succeeded. Change-Id: I9525628daf48082e979b0093fa0478934495e61f BUG: 1273334 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/12399 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'xlators/cluster/afr/src/afr.h') diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 6a14febec0a..9ee5ae36df0 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -662,11 +662,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 -- cgit