diff options
author | Ravishankar N <ravishankar@redhat.com> | 2015-08-07 12:52:23 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-08-12 05:35:06 -0700 |
commit | b95d40bfd760525f0c3e1cf0a11a8087c17a7110 (patch) | |
tree | 846827838e93d12dc1d6238b6fee0b1c76a48d76 /xlators/cluster/afr/src/afr-common.c | |
parent | e4726e843574c0db108fce1fc375241b72d7aed4 (diff) |
afr: Do not wind statfs to arbiter brick
Backport of: http://review.gluster.org/#/c/11857/
Problem: AFR serves statfs from the brick having the least free space
available. Since the size to be allocated to the arbiter brick in a 3
way replica is supposed to be considerably lesser than the other 2
bricks, statfs will be served from this brick which is incorrect.
Fix: Don't serve statfs from the arbiter brick.
Change-Id: Ia2d2402ba1e8f5d96831f71b3f8337f241e6753b
BUG: 1251380
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/11858
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 31c6eff1fa8..bbc870aa671 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -650,7 +650,7 @@ afr_accuse_smallfiles (xlator_t *this, struct afr_reply *replies, for (i = 0; i < priv->child_count; i++) { if (data_accused[i]) continue; - if ((priv->arbiter_count == 1) && (i == ARBITER_BRICK_INDEX)) + if (AFR_IS_ARBITER_BRICK(priv, i)) continue; if (replies[i].poststat.ia_size < maxsize) data_accused[i] = 1; @@ -1737,8 +1737,7 @@ afr_local_discovery_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ if (is_local) { /* Don't set arbiter as read child. */ - if ((priv->arbiter_count == 1) && - (child_index == ARBITER_BRICK_INDEX)) + if (AFR_IS_ARBITER_BRICK(priv, child_index)) goto out; gf_msg (this->name, GF_LOG_INFO, 0, AFR_MSG_LOCAL_CHILD, "selecting local read_child %s", @@ -3621,6 +3620,8 @@ afr_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) if (!local) goto out; + if (priv->arbiter_count == 1 && local->child_up[ARBITER_BRICK_INDEX]) + local->call_count--; call_count = local->call_count; if (!call_count) { op_errno = ENOTCONN; @@ -3629,6 +3630,8 @@ afr_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) for (i = 0; i < priv->child_count; i++) { if (local->child_up[i]) { + if (AFR_IS_ARBITER_BRICK(priv, i)) + continue; STACK_WIND (frame, afr_statfs_cbk, priv->children[i], priv->children[i]->fops->statfs, |