|
|
3604df |
From 9f78a1dc55745042ecaed019ad0fc58d9e80d85e Mon Sep 17 00:00:00 2001
|
|
|
3604df |
From: Ravishankar N <ravishankar@redhat.com>
|
|
|
3604df |
Date: Fri, 14 Oct 2016 16:09:08 +0530
|
|
|
3604df |
Subject: [PATCH 102/141] afr: Take full locks in arbiter only for data transactions
|
|
|
3604df |
|
|
|
3604df |
Patch in master: http://review.gluster.org/#/c/15641/
|
|
|
3604df |
Patch in release-3.8: http://review.gluster.org/#/c/15647/
|
|
|
3604df |
Patch in release-3.9: http://review.gluster.org/#/c/15648/
|
|
|
3604df |
|
|
|
3604df |
Problem:
|
|
|
3604df |
Sharding exposed a bug in arbiter config. where `dd` throughput was
|
|
|
3604df |
extremely slow. Shard xlator was sending a fxattrop to update the file
|
|
|
3604df |
size immediately after a writev. Arbiter was incorrectly over-riding the
|
|
|
3604df |
LLONGMAX-1 start offset (for metadata domain locks) for this fxattrop,
|
|
|
3604df |
causing the inodelk to be taken on the data domain. And since the
|
|
|
3604df |
preceeding writev hadn't released the lock (afr does a 'lazy'
|
|
|
3604df |
unlock if write succeeds on all bricks), this degraded to a blocking
|
|
|
3604df |
lock causing extra lock/unlock calls and delays.
|
|
|
3604df |
|
|
|
3604df |
Fix:
|
|
|
3604df |
Modify flock.l_len and flock.l_start to take full locks only for data
|
|
|
3604df |
transactions.
|
|
|
3604df |
|
|
|
3604df |
Change-Id: If9ca04b7a27e42ddedf185c4c36689ab53b39d54
|
|
|
3604df |
BUG: 1380276
|
|
|
3604df |
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
|
|
|
3604df |
Reviewed-on: https://code.engineering.redhat.com/gerrit/87216
|
|
|
3604df |
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
3604df |
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
3604df |
---
|
|
|
3604df |
xlators/cluster/afr/src/afr-transaction.c | 3 ++-
|
|
|
3604df |
1 files changed, 2 insertions(+), 1 deletions(-)
|
|
|
3604df |
|
|
|
3604df |
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
|
|
|
3604df |
index 27be045..856ea6e 100644
|
|
|
3604df |
--- a/xlators/cluster/afr/src/afr-transaction.c
|
|
|
3604df |
+++ b/xlators/cluster/afr/src/afr-transaction.c
|
|
|
3604df |
@@ -1900,7 +1900,8 @@ afr_set_transaction_flock (xlator_t *this, afr_local_t *local)
|
|
|
3604df |
inodelk = afr_get_inodelk (int_lock, int_lock->domain);
|
|
|
3604df |
priv = this->private;
|
|
|
3604df |
|
|
|
3604df |
- if (priv->arbiter_count) {
|
|
|
3604df |
+ if (priv->arbiter_count &&
|
|
|
3604df |
+ local->transaction.type == AFR_DATA_TRANSACTION) {
|
|
|
3604df |
/*Lock entire file to avoid network split brains.*/
|
|
|
3604df |
inodelk->flock.l_len = 0;
|
|
|
3604df |
inodelk->flock.l_start = 0;
|
|
|
3604df |
--
|
|
|
3604df |
1.7.1
|
|
|
3604df |
|