From 5b24934668adb89e1dcd3888ac19555056508f06 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 10 Jan 2017 13:26:02 +0530 Subject: cluster/afr: Do not log of split-brain when there isn't one * Even on errors like ENOENT, AFR logs split-brain after read-txn refresh, introduced by commit a07ddd8f. This can be a cause of much panic and confusion and needs to be fixed. * Also fixed this issue in write-txns. * Fixed afr read txns to log about split-brain only after knowing that there is no split-brain choice configured. * Removed code duplication * Fixed incorrect passing of error code in afr_write_txn_refresh_done() (the function was passing -0 as errno to gf_msg(). Change-Id: I354f454ce5bf0e5f00bc27916eb597367cb7d927 BUG: 1411625 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/16362 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Ravishankar N Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/afr/src/afr-transaction.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'xlators/cluster/afr/src/afr-transaction.c') diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 9cfd3bf89ec..cbfddf2009d 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -2614,14 +2614,9 @@ int afr_write_txn_refresh_done (call_frame_t *frame, xlator_t *this, int err) { afr_local_t *local = frame->local; - int ret = 0; if (err) { - local->op_errno = -err; - local->op_ret = -1; - gf_msg (this->name, GF_LOG_ERROR, -ret, AFR_MSG_SPLIT_BRAIN, - "Failing %s on gfid %s: split-brain observed.", - gf_fop_list[local->op], uuid_utoa (local->inode->gfid)); + AFR_SET_ERROR_AND_CHECK_SPLIT_BRAIN(-1, -err); goto fail; } -- cgit