diff options
| author | Shreyas Siravara <sshreyas@fb.com> | 2016-07-16 08:22:43 -0700 |
|---|---|---|
| committer | Shreyas Siravara <sshreyas@fb.com> | 2016-12-14 18:10:30 -0800 |
| commit | 1ad70fb05cadf14aa5900ba642119e73a3f25c73 (patch) | |
| tree | f482ac9d24a3f5209a3131ce8c82b0d3622a2f9b /tests/basic | |
| parent | b43e301657e81d541174bade1f496caffc1c4aa5 (diff) | |
write-behind: Allow trickling-writes to be configurable, fix usage of page_size and window_size
Summary:
- It adds a configurable option for "trickling-writes".
- Makes `__wb_preprocess_winds()` use `wb_inode->window_conf` rather
than `page_size`, so that the window-size option is actually
respected.
- This is a port of D3576122 & D3738605 to 3.8.
Test Plan:
- Prove test which looks @ brick-level FOPs and ensures
that they fall in the right write-size bucket.
Reviewed By: rwareing
Signature: t1:3576122:1468892648:6923a6a19b18888577ce5173b5c9cb9531f941e7
Change-Id: I379a9f2f0c4768c9052b7e9dd71c5f0469cb2d68
Signed-off-by: Shreyas Siravara <sshreyas@fb.com>
Reviewed-on: http://review.gluster.org/16079
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kevin Vigor <kvigor@fb.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'tests/basic')
| -rw-r--r-- | tests/basic/write-behind.t | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/basic/write-behind.t b/tests/basic/write-behind.t new file mode 100644 index 00000000000..edad59786af --- /dev/null +++ b/tests/basic/write-behind.t @@ -0,0 +1,53 @@ +#!/bin/bash +# + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +function clear_stats { + > /var/lib/glusterfs/stats/glusterfs_d_backends_${V0}0.dump +} + +function got_expected_write_count { + expected_size=$1 + expected_value=$2 + grep aggr.write_${expected_size} "/var/lib/glusterd/stats/glusterfsd__d_backends_${V0}0.dump" | grep $expected_value + if [ $? == 0 ]; then + echo "Y"; + else + echo "N"; + fi +} + +cleanup; + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2} + +# These are needed for our tracking of write sizes +TEST $CLI volume set $V0 diagnostics.latency-measurement on +TEST $CLI volume set $V0 diagnostics.count-fop-hits on +TEST $CLI volume set $V0 diagnostics.stats-dump-interval 2 + +# Disable this in testing to get deterministic results +TEST $CLI volume set $V0 performance.write-behind-trickling-writes off + +TEST $CLI volume start $V0 + +sleep 2; + +TEST glusterfs -s $H0 --volfile-id $V0 $M0 + +# Write a 100MB file with a window-size 1MB, we should get 100 writes of 1MB each +TEST dd if=/dev/zero of=$M0/100mb_file bs=1M count=100 +EXPECT_WITHIN 5 "Y" got_expected_write_count "1mb" 100 + +TEST $CLI volume set $V0 performance.write-behind-window-size 512KB + +# Write a 100MB file with a window-size 512KB, we should get 200 writes of 512KB each +TEST dd if=/dev/zero of=$M0/100mb_file_2 bs=1M count=100 +EXPECT_WITHIN 5 "Y" got_expected_write_count "512kb" 200 + +cleanup; |
