From 1ad70fb05cadf14aa5900ba642119e73a3f25c73 Mon Sep 17 00:00:00 2001 From: Shreyas Siravara Date: Sat, 16 Jul 2016 08:22:43 -0700 Subject: 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 Reviewed-on: http://review.gluster.org/16079 NetBSD-regression: NetBSD Build System Smoke: Gluster Build System Reviewed-by: Kevin Vigor CentOS-regression: Gluster Build System --- tests/basic/write-behind.t | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tests/basic/write-behind.t (limited to 'tests/basic') 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; -- cgit