summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-01-17 21:11:28 +0530
committerAnand Avati <avati@redhat.com>2013-01-18 15:57:56 -0800
commit13c1c105146288a12210dfbd2b2c4cbbd6960c06 (patch)
tree737fcc70af629d9eaea2438e0f74d66e4799773a
parent1ad17d69832369acf6177c378ddd8053174e8b6e (diff)
cluster/afr: Disable delayed post op when eager-lock is off
Problem: When eager-lock is disabled, inodelks for write-fops on same fd conflict with each other. If eager-lock is disabled but delayed post-op is enabled then each write fop's inodelk unlock waits for post-op-delay-secs. So the conflicting write fop acquires inodelk after post-op-delay-secs. This results in post-op-delay-secs delay for every write fop on the fd for sequential writes (Ex: dd). Fix: Disable delayed-post-op when eager-lock is off. Change-Id: I87ea4c8d1c7bb269b9b174388ae50f37e82629b7 BUG: 895235 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/4391 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--tests/bugs/bug-895235.t21
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c3
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/bugs/bug-895235.t b/tests/bugs/bug-895235.t
new file mode 100644
index 00000000000..a9f176a7681
--- /dev/null
+++ b/tests/bugs/bug-895235.t
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+TEST glusterd
+TEST pidof glusterd
+
+TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1}
+TEST $CLI volume set $V0 performance.write-behind off
+TEST $CLI volume set $V0 cluster.eager-lock off
+TEST $CLI volume start $V0
+TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id=$V0 $M0 --direct-io-mode=enable
+
+T=$(date +%s)
+TEST dd of=$M0/a if=/dev/zero bs=1M count=1 oflag=append
+T1=$(date +%s)
+EXPECT "0" echo "$(($T1-$T))"
+
+cleanup;
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 73dd50f67eb..a1700783709 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -1275,6 +1275,9 @@ afr_set_delayed_post_op (call_frame_t *frame, xlator_t *this)
if (!priv->post_op_delay_secs)
return;
+ if (!priv->eager_lock)
+ return;
+
local = frame->local;
if (!local)
return;