summaryrefslogtreecommitdiffstats
path: root/tests/volume.rc
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2018-03-19 15:12:14 +0530
committerPranith Kumar K <pkarampu@redhat.com>2018-03-21 10:36:31 +0530
commit2da6650dfa402143c7b9ea0e67bbda79d0475ddd (patch)
tree4b778625eaded65bfe998ce8cbcc69e9ce69b4d1 /tests/volume.rc
parentade6262cb63b96834dce101a4a237c0c8128077e (diff)
storage/posix: Add active-fd-count option in gluster
Problem: when dd happens on sharded replicate volume all the writes on shards happen through anon-fd. When the writes don't come quick enough, old anon-fd closes and new fd gets created to serve the new writes. open-fd-count is decremented only after the fd is closed as part of fd_destroy(). So even when one fd is on the way to be closed a new fd will be created and during this short period it appears as though there are multiple fds opened on the file. AFR thinks another application opened the same file and switches off eager-lock leading to extra latency. Fix: Have a different option called active-fd whose life cycle starts at fd_bind() and ends just before fd_destroy() BUG: 1557932 Change-Id: I2e221f6030feeedf29fbb3bd6554673b8a5b9c94 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'tests/volume.rc')
-rw-r--r--tests/volume.rc14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index add812d..4442860 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -808,7 +808,19 @@ function get_fd_count {
local fname=$4
local gfid_str=$(gf_gfid_xattr_to_str $(gf_get_gfid_xattr $brick/$fname))
local statedump=$(generate_brick_statedump $vol $host $brick)
- local count=$(grep "gfid=$gfid_str" $statedump -A2 -B1 | grep $brick -A3 | grep fd-count | cut -f2 -d'=' | tail -1)
+ local count=$(grep "gfid=$gfid_str" $statedump -A2 -B1 | grep $brick -A3 | grep -w fd-count | cut -f2 -d'=' | tail -1)
+ rm -f $statedump
+ echo $count
+}
+
+function get_active_fd_count {
+ local vol=$1
+ local host=$2
+ local brick=$3
+ local fname=$4
+ local gfid_str=$(gf_gfid_xattr_to_str $(gf_get_gfid_xattr $brick/$fname))
+ local statedump=$(generate_brick_statedump $vol $host $brick)
+ local count=$(grep "gfid=$gfid_str" $statedump -A2 -B1 | grep $brick -A3 | grep -w active-fd-count | cut -f2 -d'=' | tail -1)
rm -f $statedump
echo $count
}