diff options
| author | Krutika Dhananjay <kdhananj@redhat.com> | 2017-01-10 13:26:02 +0530 |
|---|---|---|
| committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2017-01-16 22:22:09 -0800 |
| commit | 29f15ec5a43bb7df58457df8cad28df994b8b1f5 (patch) | |
| tree | 230f125c26cb0d4ed24b74365280182a750d48c5 /xlators/cluster/afr/src/afr.h | |
| parent | 66bd1686e90c339ce140bee55ccc1f195b2c862a (diff) | |
cluster/afr: Do not log of split-brain when there isn't one
Backport of: http://review.gluster.org/16362
* 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: I21ac7f6e31840fe3da2f9eecccc495056ab46ece
BUG: 1412915
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/16393
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
| -rw-r--r-- | xlators/cluster/afr/src/afr.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 8dfa78fdc38..6334c745c00 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -51,6 +51,18 @@ typedef int (*afr_changelog_resume_t) (call_frame_t *frame, xlator_t *this); #define AFR_CMP(a1,a2,len) ({int __cmp = 0; int __i; for (__i = 0; __i < len; __i++) if (a1[__i] != a2[__i]) { __cmp = 1; break;} __cmp;}) #define AFR_IS_ARBITER_BRICK(priv, index) ((priv->arbiter_count == 1) && (index == ARBITER_BRICK_INDEX)) +#define AFR_SET_ERROR_AND_CHECK_SPLIT_BRAIN(ret, errnum) \ + do { \ + local->op_ret = ret; \ + local->op_errno = errnum; \ + if (local->op_errno == EIO) \ + gf_msg (this->name, GF_LOG_ERROR, local->op_errno, \ + AFR_MSG_SPLIT_BRAIN, "Failing %s on gfid %s: " \ + "split-brain observed.", \ + gf_fop_list[local->op], \ + uuid_utoa (local->inode->gfid)); \ + } while (0) + typedef enum { AFR_FAV_CHILD_NONE, AFR_FAV_CHILD_BY_SIZE, |
