diff options
author | Ravishankar N <ravishankar@redhat.com> | 2015-04-15 22:22:08 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-05 00:06:34 -0700 |
commit | 25e8e74eb7b81ccd114a9833371a3f72d284c48d (patch) | |
tree | 0c82b2ad9133c55c74852ce65d027bc36ed6cac5 /xlators/cluster/afr/src/afr-self-heal-data.c | |
parent | 6d7428d2018c061ca2791443bd90980f9755ded3 (diff) |
afr: add arbitration support
Add logic in afr to work in conjunction with the arbiter xlator when a
replica 3 arbiter volume is created. More specifically, this patch:
* Enables full locks for afr data transaction for such volumes.
* Removes the upfront marking of pending xattrs at the time of pre-op
and defer it to post-op. (This is an arbiter independent change and is made for all afr transactions.)
* After pre-op stage, check if we can proceed with the fop stage without
ending up in split-brain by examining the changelog xattrs.
* Unwinds the fop with failure if only one source was available at the
time of pre-op and the fop happened to fail on particular source brick.
* Skips data self-heal if arbiter brick is the only source available.
* Adds the arbiter-count option to the shd graph.
This patch is a part of the arbiter logic implementation for 3 way AFR
details of which can be found at http://review.gluster.org/#/c/9656/
Change-Id: I9603db9d04de5626eb2f4d8d959ef5b46113561d
BUG: 1199985
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/10258
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index a8a7326e4ec..7567fe9f851 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -684,6 +684,12 @@ __afr_selfheal_data (call_frame_t *frame, xlator_t *this, fd_t *fd, source = ret; + if (priv->arbiter_count == 1 && source == ARBITER_BRICK_INDEX && + AFR_COUNT (sources, priv->child_count) == 1) { + did_sh = _gf_false; + goto unlock; + } + ret = __afr_selfheal_truncate_sinks (frame, this, fd, healed_sinks, locked_replies, locked_replies[source].poststat.ia_size); |