From f6e72c45ad754073bc8269e954d236bab9e4a0e7 Mon Sep 17 00:00:00 2001 From: vmallika Date: Thu, 28 May 2015 12:30:02 +0530 Subject: Quota: fix testcases not to send parallel writes for accurate quota enforcement This is a backport of http://review.gluster.org/#/c/10878 > Currently quota enforcer doesn't consider parallel writes > and allows quota to exceed limit where there are high rate > of parallel writes. Bug# 1223658 tracks the issue. > > This patch fixes the spurious failures by not sending > parallel writes. > Using O_SYNC and O_APPEND flags and block size > not more that 256k (For higher block size NFS client > splits the block into 256k chinks and does parallel writes) > > Change-Id: I297c164b030cecb87ce5b494c02b09e8b073b276 > BUG: 1223798 > Signed-off-by: vmallika > Reviewed-on: http://review.gluster.org/10878 > Tested-by: NetBSD Build System > Tested-by: Gluster Build System > Reviewed-by: Raghavendra G > Tested-by: Raghavendra G Change-Id: I78b6250eb0b3fbbbab1d4348d4e81d6292c6c6bb BUG: 1224894 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/10910 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri --- tests/basic/ec/quota.t | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/basic/ec') diff --git a/tests/basic/ec/quota.t b/tests/basic/ec/quota.t index 0dbc07738d2..cc2d4bd9efa 100755 --- a/tests/basic/ec/quota.t +++ b/tests/basic/ec/quota.t @@ -22,6 +22,9 @@ function usage() } cleanup +QDD=$(dirname $0)/quota +# compile the test write program and run it +build_tester $(dirname $0)/../quota.c -o $QDD TEST glusterd TEST pidof glusterd @@ -44,13 +47,12 @@ EXPECT "80%" soft_limit "/test"; TEST $CLI volume quota $V0 soft-timeout 0 TEST $CLI volume quota $V0 hard-timeout 0 -TEST ! dd if=/dev/urandom of=$M0/test/file1.txt bs=1024k count=12 -sleep 5 +TEST ! $QDD $M0/test/file1.txt 256 48 TEST rm $M0/test/file1.txt EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" usage "/test" -TEST dd if=/dev/urandom of=$M0/test/file2.txt bs=1024k count=8 +TEST $QDD $M0/test/file2.txt 256 32 EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test" TEST rm $M0/test/file2.txt @@ -58,4 +60,5 @@ EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" usage "/test" TEST $CLI volume stop $V0 EXPECT "1" get_aux +rm -f $QDD cleanup; -- cgit