|
|
d1681e |
From 5b32d4317968581f217c82e893822852d63eeae8 Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
d1681e |
Date: Mon, 19 Mar 2018 15:26:40 +0530
|
|
|
d1681e |
Subject: [PATCH 196/201] cluster/afr: Switch to active-fd-count for open-fd
|
|
|
d1681e |
checks
|
|
|
d1681e |
|
|
|
d1681e |
>BUG: 1557932
|
|
|
d1681e |
|
|
|
d1681e |
Upstream-patch: https://review.gluster.org/19741
|
|
|
d1681e |
BUG: 1491785
|
|
|
d1681e |
Change-Id: I3783e41b3812267bc10c0d05d062a31396ce135b
|
|
|
d1681e |
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/133660
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
tests/basic/afr/afr-no-fsync.t | 20 ++++++++++++++++++++
|
|
|
d1681e |
xlators/cluster/afr/src/afr-inode-write.c | 16 ++++++++--------
|
|
|
d1681e |
2 files changed, 28 insertions(+), 8 deletions(-)
|
|
|
d1681e |
create mode 100644 tests/basic/afr/afr-no-fsync.t
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/tests/basic/afr/afr-no-fsync.t b/tests/basic/afr/afr-no-fsync.t
|
|
|
d1681e |
new file mode 100644
|
|
|
d1681e |
index 0000000..0966d9b
|
|
|
d1681e |
--- /dev/null
|
|
|
d1681e |
+++ b/tests/basic/afr/afr-no-fsync.t
|
|
|
d1681e |
@@ -0,0 +1,20 @@
|
|
|
d1681e |
+#!/bin/bash
|
|
|
d1681e |
+#Tests that sequential write workload doesn't lead to FSYNCs
|
|
|
d1681e |
+
|
|
|
d1681e |
+. $(dirname $0)/../../include.rc
|
|
|
d1681e |
+. $(dirname $0)/../../volume.rc
|
|
|
d1681e |
+
|
|
|
d1681e |
+cleanup;
|
|
|
d1681e |
+
|
|
|
d1681e |
+TEST glusterd
|
|
|
d1681e |
+TEST pidof glusterd
|
|
|
d1681e |
+TEST $CLI volume create $V0 replica 3 $H0:$B0/brick{0,1,3}
|
|
|
d1681e |
+TEST $CLI volume set $V0 features.shard on
|
|
|
d1681e |
+TEST $CLI volume set $V0 performance.flush-behind off
|
|
|
d1681e |
+TEST $CLI volume start $V0
|
|
|
d1681e |
+TEST $CLI volume profile $V0 start
|
|
|
d1681e |
+TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0;
|
|
|
d1681e |
+TEST dd if=/dev/zero of=$M0/a bs=1M count=500
|
|
|
d1681e |
+TEST ! "$CLI volume profile $V0 info incremental | grep FSYNC"
|
|
|
d1681e |
+
|
|
|
d1681e |
+cleanup;
|
|
|
d1681e |
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
|
|
|
d1681e |
index b52b6ca..9e6ba35 100644
|
|
|
d1681e |
--- a/xlators/cluster/afr/src/afr-inode-write.c
|
|
|
d1681e |
+++ b/xlators/cluster/afr/src/afr-inode-write.c
|
|
|
d1681e |
@@ -314,10 +314,10 @@ afr_inode_write_fill (call_frame_t *frame, xlator_t *this, int child_index,
|
|
|
d1681e |
if (ret || !write_is_append)
|
|
|
d1681e |
local->append_write = _gf_false;
|
|
|
d1681e |
|
|
|
d1681e |
- ret = dict_get_uint32 (xdata, GLUSTERFS_OPEN_FD_COUNT,
|
|
|
d1681e |
- &open_fd_count);
|
|
|
d1681e |
- if (ret == -1)
|
|
|
d1681e |
- goto unlock;
|
|
|
d1681e |
+ ret = dict_get_uint32 (xdata, GLUSTERFS_ACTIVE_FD_COUNT,
|
|
|
d1681e |
+ &open_fd_count);
|
|
|
d1681e |
+ if (ret < 0)
|
|
|
d1681e |
+ goto unlock;
|
|
|
d1681e |
if (open_fd_count > local->open_fd_count) {
|
|
|
d1681e |
local->open_fd_count = open_fd_count;
|
|
|
d1681e |
local->update_open_fd_count = _gf_true;
|
|
|
d1681e |
@@ -529,10 +529,10 @@ afr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
d1681e |
if (ret)
|
|
|
d1681e |
goto out;
|
|
|
d1681e |
|
|
|
d1681e |
- if (dict_set_uint32 (local->xdata_req, GLUSTERFS_OPEN_FD_COUNT, 4)) {
|
|
|
d1681e |
- op_errno = ENOMEM;
|
|
|
d1681e |
- goto out;
|
|
|
d1681e |
- }
|
|
|
d1681e |
+ if (dict_set_uint32 (local->xdata_req, GLUSTERFS_ACTIVE_FD_COUNT, 4)) {
|
|
|
d1681e |
+ op_errno = ENOMEM;
|
|
|
d1681e |
+ goto out;
|
|
|
d1681e |
+ }
|
|
|
d1681e |
|
|
|
d1681e |
if (dict_set_uint32 (local->xdata_req, GLUSTERFS_WRITE_IS_APPEND, 4)) {
|
|
|
d1681e |
op_errno = ENOMEM;
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|