Blob Blame History Raw
From 7783b35987db2a7cdebb7d7f02e0073c632c49c6 Mon Sep 17 00:00:00 2001
From: Krutika Dhananjay <kdhananj@redhat.com>
Date: Thu, 23 Jul 2015 18:08:34 +0530
Subject: [PATCH 249/279] cluster/afr: Fix incorrect logging in read transactions

        Backport of: http://review.gluster.org/11756

afr_read_txn_refresh_done() at its entry point can fail for
reasons like ENOENT/ESTALE but seldom due to EIO, which is something
_AFR_ would internally generate and not receive in response from
a child translator. AFR is reporting "split-brain" for _any_
kind of failure in read txn, of the following kind:

[2015-07-07 18:04:34.787612] E [MSGID: 108008]
[afr-read-txn.c:76:afr_read_txn_refresh_done] 0-vol3-replicate-3:
Failing STAT on gfid 18a973c4-73d3-48b8-942c-33a6f1a8e6b4:
split-brain observed. [Input/output error]

This patch fixes such misleading errors.

To-Do:
Avoid logging EIO error if/when split-brain choice is set.
Will do that as part of a separate commit.

Change-Id: I4d75b9ebfd79805e23f8e8265a62a06558411493
BUG: 1240657
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/53813
Reviewed-by: Ravishankar Narayanankutty <ravishankar@redhat.com>
Tested-by: Ravishankar Narayanankutty <ravishankar@redhat.com>
---
 xlators/cluster/afr/src/afr-read-txn.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xlators/cluster/afr/src/afr-read-txn.c b/xlators/cluster/afr/src/afr-read-txn.c
index a998cce..1b2faf3 100644
--- a/xlators/cluster/afr/src/afr-read-txn.c
+++ b/xlators/cluster/afr/src/afr-read-txn.c
@@ -72,8 +72,12 @@ afr_read_txn_refresh_done (call_frame_t *frame, xlator_t *this, int err)
 	local = frame->local;
 	inode = local->inode;
 
-	if (err)
-                AFR_READ_TXN_SET_ERROR_AND_GOTO (-1, -err, -1, readfn);
+        if (err) {
+                local->op_errno = -err;
+                local->op_ret = -1;
+                read_subvol = -1;
+                goto readfn;
+        }
 
 	ret = afr_inode_get_readable (frame, inode, this, local->readable,
 			              &event_generation,
-- 
1.7.1