|
|
3604df |
From 0895aa838086ff8dfbdb2c32f2e8268afd688d17 Mon Sep 17 00:00:00 2001
|
|
|
3604df |
From: Ravishankar N <ravishankar@redhat.com>
|
|
|
3604df |
Date: Tue, 20 Dec 2016 07:05:02 +0530
|
|
|
3604df |
Subject: [PATCH 250/257] afr: Ignore event_generation checks post inode
|
|
|
3604df |
refresh for write txns
|
|
|
3604df |
|
|
|
3604df |
Backport of http://review.gluster.org/#/c/16205/
|
|
|
3604df |
|
|
|
3604df |
Before https://code.engineering.redhat.com/gerrit/91354, after inode refresh,
|
|
|
3604df |
we failed read txns in case of EIO or event_generation being zero. For
|
|
|
3604df |
write transactions, the check was only for EIO. 91354 re-factored the
|
|
|
3604df |
code to fail both read and write when event_generation=0. This seems to
|
|
|
3604df |
have caused a regression as explained in the BZ.
|
|
|
3604df |
|
|
|
3604df |
This patch restores that behaviour in afr_txn_refresh_done().
|
|
|
3604df |
|
|
|
3604df |
Change-Id: I4dd5c56f9a5b451744b5426f5ddcfcad2a8ed20e
|
|
|
3604df |
BUG: 1404982
|
|
|
3604df |
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
|
|
|
3604df |
Reviewed-on: https://code.engineering.redhat.com/gerrit/93560
|
|
|
3604df |
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
3604df |
---
|
|
|
3604df |
xlators/cluster/afr/src/afr-common.c | 2 +-
|
|
|
3604df |
xlators/cluster/afr/src/afr-read-txn.c | 1 +
|
|
|
3604df |
xlators/cluster/afr/src/afr.h | 2 ++
|
|
|
3604df |
3 files changed, 4 insertions(+), 1 deletion(-)
|
|
|
3604df |
|
|
|
3604df |
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
|
|
|
3604df |
index 60bae18..2e93ba9 100644
|
|
|
3604df |
--- a/xlators/cluster/afr/src/afr-common.c
|
|
|
3604df |
+++ b/xlators/cluster/afr/src/afr-common.c
|
|
|
3604df |
@@ -1089,7 +1089,7 @@ afr_txn_refresh_done (call_frame_t *frame, xlator_t *this, int err)
|
|
|
3604df |
&event_generation,
|
|
|
3604df |
local->transaction.type);
|
|
|
3604df |
|
|
|
3604df |
- if (ret == -EIO || !event_generation) {
|
|
|
3604df |
+ if (ret == -EIO || (local->is_read_txn && !event_generation)) {
|
|
|
3604df |
/* No readable subvolume even after refresh ==> splitbrain.*/
|
|
|
3604df |
if (!priv->fav_child_policy) {
|
|
|
3604df |
err = -EIO;
|
|
|
3604df |
diff --git a/xlators/cluster/afr/src/afr-read-txn.c b/xlators/cluster/afr/src/afr-read-txn.c
|
|
|
3604df |
index fa98d37..6ed1bcd 100644
|
|
|
3604df |
--- a/xlators/cluster/afr/src/afr-read-txn.c
|
|
|
3604df |
+++ b/xlators/cluster/afr/src/afr-read-txn.c
|
|
|
3604df |
@@ -201,6 +201,7 @@ afr_read_txn (call_frame_t *frame, xlator_t *this, inode_t *inode,
|
|
|
3604df |
|
|
|
3604df |
local->readfn = readfn;
|
|
|
3604df |
local->inode = inode_ref (inode);
|
|
|
3604df |
+ local->is_read_txn = _gf_true;
|
|
|
3604df |
|
|
|
3604df |
if (priv->quorum_reads &&
|
|
|
3604df |
priv->quorum_count && !afr_has_quorum (priv->child_up, this)) {
|
|
|
3604df |
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
|
|
|
3604df |
index 63002cd..69d0584 100644
|
|
|
3604df |
--- a/xlators/cluster/afr/src/afr.h
|
|
|
3604df |
+++ b/xlators/cluster/afr/src/afr.h
|
|
|
3604df |
@@ -807,6 +807,8 @@ typedef struct _afr_local {
|
|
|
3604df |
gf_boolean_t compound;
|
|
|
3604df |
afr_fop_lock_state_t fop_lock_state;
|
|
|
3604df |
compound_args_t *c_args;
|
|
|
3604df |
+
|
|
|
3604df |
+ gf_boolean_t is_read_txn;
|
|
|
3604df |
} afr_local_t;
|
|
|
3604df |
|
|
|
3604df |
|
|
|
3604df |
--
|
|
|
3604df |
2.9.3
|
|
|
3604df |
|