Whamcloud - gitweb
LU-17588 tests: test_block_soft: set max_diry_mb=1 08/54208/6
authorSergey Cheremencev <scherementsev@ddn.com>
Wed, 28 Feb 2024 19:19:47 +0000 (22:19 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Jan 2025 22:03:47 +0000 (22:03 +0000)
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 <scherementsev@ddn.com>
Change-Id: I0f430051b3f9f37a0c628ea33e108f9bd42838ed
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54208
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-quota.sh

index f0661f9..c2144ef 100755 (executable)
@@ -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