summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-write.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-08-27 13:42:41 +0530
committerAnand Avati <avati@redhat.com>2013-08-28 17:42:59 -0700
commitdb0b19a5420d417cf4da70bf886b53619e17a739 (patch)
tree07dcdd05912fecc438a13c2d3e634768ebd157e3 /xlators/cluster/afr/src/afr-inode-write.c
parentb880b6b2908ad4e4afc8e26613bd0db8f0b28750 (diff)
cluster/afr: Add special handling for failure postops
Idea is to not leave the file in FOOL-FOOL scenario in case on all the bricks data transaction failed with EDQUOT to avoid increasing un-necessary load of self-heals in the system. For directory transactions don't leave pending changelog in case the failures are seen on all the subvolumes. Change-Id: I38a5561d1d581a78347a76a4a509514e4a0c3fb7 BUG: 969461 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/5709 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 27107439606..18ea323f176 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -157,8 +157,10 @@ afr_writev_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->replies[child_index].op_ret = op_ret;
local->replies[child_index].op_errno = op_errno;
- if (afr_fop_failed (op_ret, op_errno))
+ if (afr_fop_failed (op_ret, op_errno)) {
afr_transaction_fop_failed (frame, this, child_index);
+ local->child_errno[child_index] = op_errno;
+ }
/* stage the best case return value for unwind */
if ((local->success_count == 0) || (op_ret > local->op_ret)) {
@@ -599,8 +601,10 @@ afr_truncate_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->read_child_returned = _gf_true;
}
- if (afr_fop_failed (op_ret, op_errno) && op_errno != EFBIG)
+ if (afr_fop_failed (op_ret, op_errno) && op_errno != EFBIG) {
afr_transaction_fop_failed (frame, this, child_index);
+ local->child_errno[child_index] = op_errno;
+ }
if (op_ret != -1) {
if (local->success_count == 0) {
@@ -798,8 +802,10 @@ afr_ftruncate_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->read_child_returned = _gf_true;
}
- if (afr_fop_failed (op_ret, op_errno))
+ if (afr_fop_failed (op_ret, op_errno)) {
afr_transaction_fop_failed (frame, this, child_index);
+ local->child_errno[child_index] = op_errno;
+ }
if (op_ret != -1) {
if (local->success_count == 0) {