cb8e9e
From 7783b35987db2a7cdebb7d7f02e0073c632c49c6 Mon Sep 17 00:00:00 2001
cb8e9e
From: Krutika Dhananjay <kdhananj@redhat.com>
cb8e9e
Date: Thu, 23 Jul 2015 18:08:34 +0530
cb8e9e
Subject: [PATCH 249/279] cluster/afr: Fix incorrect logging in read transactions
cb8e9e
cb8e9e
        Backport of: http://review.gluster.org/11756
cb8e9e
cb8e9e
afr_read_txn_refresh_done() at its entry point can fail for
cb8e9e
reasons like ENOENT/ESTALE but seldom due to EIO, which is something
cb8e9e
_AFR_ would internally generate and not receive in response from
cb8e9e
a child translator. AFR is reporting "split-brain" for _any_
cb8e9e
kind of failure in read txn, of the following kind:
cb8e9e
cb8e9e
[2015-07-07 18:04:34.787612] E [MSGID: 108008]
cb8e9e
[afr-read-txn.c:76:afr_read_txn_refresh_done] 0-vol3-replicate-3:
cb8e9e
Failing STAT on gfid 18a973c4-73d3-48b8-942c-33a6f1a8e6b4:
cb8e9e
split-brain observed. [Input/output error]
cb8e9e
cb8e9e
This patch fixes such misleading errors.
cb8e9e
cb8e9e
To-Do:
cb8e9e
Avoid logging EIO error if/when split-brain choice is set.
cb8e9e
Will do that as part of a separate commit.
cb8e9e
cb8e9e
Change-Id: I4d75b9ebfd79805e23f8e8265a62a06558411493
cb8e9e
BUG: 1240657
cb8e9e
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/53813
cb8e9e
Reviewed-by: Ravishankar Narayanankutty <ravishankar@redhat.com>
cb8e9e
Tested-by: Ravishankar Narayanankutty <ravishankar@redhat.com>
cb8e9e
---
cb8e9e
 xlators/cluster/afr/src/afr-read-txn.c |    8 ++++++--
cb8e9e
 1 files changed, 6 insertions(+), 2 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/cluster/afr/src/afr-read-txn.c b/xlators/cluster/afr/src/afr-read-txn.c
cb8e9e
index a998cce..1b2faf3 100644
cb8e9e
--- a/xlators/cluster/afr/src/afr-read-txn.c
cb8e9e
+++ b/xlators/cluster/afr/src/afr-read-txn.c
cb8e9e
@@ -72,8 +72,12 @@ afr_read_txn_refresh_done (call_frame_t *frame, xlator_t *this, int err)
cb8e9e
 	local = frame->local;
cb8e9e
 	inode = local->inode;
cb8e9e
 
cb8e9e
-	if (err)
cb8e9e
-                AFR_READ_TXN_SET_ERROR_AND_GOTO (-1, -err, -1, readfn);
cb8e9e
+        if (err) {
cb8e9e
+                local->op_errno = -err;
cb8e9e
+                local->op_ret = -1;
cb8e9e
+                read_subvol = -1;
cb8e9e
+                goto readfn;
cb8e9e
+        }
cb8e9e
 
cb8e9e
 	ret = afr_inode_get_readable (frame, inode, this, local->readable,
cb8e9e
 			              &event_generation,
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e