diff options
author | Ravishankar N <ravishankar@redhat.com> | 2016-10-14 16:09:08 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-10-15 10:02:31 -0700 |
commit | 0cd21d981f469c3cdc57dcd84802ced1a9f34155 (patch) | |
tree | d090afa8790e38f065b5764839d954cea574b4fc /xlators/cluster/afr/src | |
parent | a95fd26fd1c7c336cb3eaaf61779883ab69b66b0 (diff) |
afr: Take full locks in arbiter only for data transactions
Problem:
Sharding exposed a bug in arbiter config. where `dd` throughput was
extremely slow. Shard xlator was sending a fxattrop to update the file
size immediately after a writev. Arbiter was incorrectly over-riding the
LLONGMAX-1 start offset (for metadata domain locks) for this fxattrop,
causing the inodelk to be taken on the data domain. And since the
preceeding writev hadn't released the lock (afr does a 'lazy'
unlock if write succeeds on all bricks), this degraded to a blocking
lock causing extra lock/unlock calls and delays.
Fix:
Modify flock.l_len and flock.l_start to take full locks only for data
transactions.
> Reviewed-on: http://review.gluster.org/15641
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> 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>
(cherry picked from commit 3a97486d7f9d0db51abcb13dcd3bc9db935e3a60)
Change-Id: I906895da2f2d16813607e6c906cb4defb21d7c3b
BUG: 1385224
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reported-by: Max Raba <max.raba@comsysto.com>
Reviewed-on: http://review.gluster.org/15648
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r-- | xlators/cluster/afr/src/afr-transaction.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index db7c6dbd2b0..663e4034fb2 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -1901,7 +1901,8 @@ afr_set_transaction_flock (xlator_t *this, afr_local_t *local) inodelk = afr_get_inodelk (int_lock, int_lock->domain); priv = this->private; - if (priv->arbiter_count) { + if (priv->arbiter_count && + local->transaction.type == AFR_DATA_TRANSACTION) { /*Lock entire file to avoid network split brains.*/ inodelk->flock.l_len = 0; inodelk->flock.l_start = 0; |