From 6cb731fbb095206e37295b9c2e5fcd6ead3b0bf1 Mon Sep 17 00:00:00 2001 From: Sergey Cheremencev Date: Wed, 28 Feb 2024 22:19:47 +0300 Subject: [PATCH] LU-17588 tests: test_block_soft: set max_diry_mb=1 Set max_dirty_mb to 1 during the test in test_block_soft. This affects 3a, 3b and 3c. Sometimes all written data could be stored in a cache because tests 3a 3b and 3c write quite small amount of data - from 4 to 6 MB. If there was no BRW at OST side, tests would fail with: Grace timeout was not set or quota not exceeded In debug logs from sanity-quota_1g failure have been found that BRW size at OST sometimes could be 4MB despite of osc*.*.max_diry_mb set to 1MB. This could be the reason of failure because the file in 1g has overstriping and one of OSTs might not reply EDQUOT to the moment of last write. Set oflag=sync to avoid that. Test-Parameters: trivial testlist=sanity-quota env=ONLY=3,ONLY_REPEAT=100 Fixes: de352465eb ("LU-17046 tests: fix write success in 1g") Signed-off-by: Sergey Cheremencev Change-Id: I0f430051b3f9f37a0c628ea33e108f9bd42838ed Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54208 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- lustre/tests/sanity-quota.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index f0661f9..c2144ef 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -527,6 +527,17 @@ test_quota_performance() { rm -f $TESTFILE } +set_max_dirty_mb() { + local mdmb=$1 # MB + local mdmb_param="osc.*.max_dirty_mb" + local old_mdmb=($($LCTL get_param -n $mdmb_param)) + + echo "old_mdmb $old_mdmb mdmb $mdmb" + stack_trap "$LCTL set_param $mdmb_param=$old_mdmb" EXIT + $LCTL set_param $mdmb_param=$mdmb || + error "set max_dirty_mb to $mdmb failed" +} + # test basic quota performance b=21696 test_0() { local MB=100 # MB @@ -1050,13 +1061,10 @@ test_1g() { local global_limit=40 # MB local testfile="$DIR/$tdir/$tfile-0" local qpool="qpool1" - local mdmb_param="osc.*.max_dirty_mb" - local max_dirty_mb=$($LCTL get_param -n $mdmb_param | head -1) mds_supports_qp setup_quota_test || error "setup quota failed with $?" - $LCTL set_param $mdmb_param=1 - stack_trap "$LCTL set_param $mdmb_param=$max_dirty_mb" EXIT + set_max_dirty_mb 1 # enable ost quota set_ost_qtype $QTYPE || error "enable ost quota failed" @@ -1092,7 +1100,7 @@ test_1g() { cancel_lru_locks osc sync; sync_all_data || true sleep 5 - $RUNAS $DD of=$testfile count=$((OSTCOUNT*3)) seek=$limit && + $RUNAS $DD of=$testfile count=$OSTCOUNT seek=$limit oflag=sync && quota_error u $TSTUSR \ "user write success, but expect EDQUOT" @@ -1526,6 +1534,7 @@ test_3a() { qmt.$FSNAME-QMT0000.dt-0x0.soft_least_qunit) / 1024 )) set_ost_qtype $QTYPE || error "enable ost quota failed" + set_max_dirty_mb 1 echo "User quota (soft limit:$limit MB grace:$grace seconds)" # make sure the system is clean @@ -1599,6 +1608,7 @@ test_3b() { echo "grace $grace glbl_grace $glbl_grace" set_ost_qtype $QTYPE || error "enable ost quota failed" + set_max_dirty_mb 1 echo "User quota in $qpool(soft limit:$limit MB grace:$grace seconds)" # make sure the system is clean @@ -1702,6 +1712,7 @@ test_3c() { echo "grace1 $grace1 grace2 $grace2 glbl_grace $glbl_grace" set_ost_qtype $QTYPE || error "enable ost quota failed" + set_max_dirty_mb 1 echo "User quota in qpool2(soft:$limit2 MB grace:$grace2 seconds)" # make sure the system is clean -- 1.8.3.1