Whamcloud - gitweb
LU-14279 test: fix block soft testing failure 94/41094/4
authorWang Shilong <wshilong@ddn.com>
Mon, 28 Dec 2020 02:33:24 +0000 (10:33 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 10 Mar 2021 08:03:05 +0000 (08:03 +0000)
Soft least qunit was introduced to avoid performance
drop when users have reached soft limit, but timer has
not reached, it tried to acquire more space(not more than
least qunit) to get reasonable performance.

Test cases need be aware of this, which means slave might
exceed quota limit a bit(but should not more than least qunit
eg 4M).

Test-Parameters: trivial testlist=sanity-quota env=ONLY="3a 3b 3c"
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: Ia221d97d158a8da4dc1fe1611aebac2f5086440e
Reviewed-on: https://review.whamcloud.com/41094
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: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-quota.sh

index 5b07fa3..f876f20 100755 (executable)
@@ -1251,6 +1251,8 @@ test_block_soft() {
        local OFFSET=0
        local qtype=$4
        local pool=$5
+       local soft_limit=$(do_facet $SINGLEMDS $LCTL get_param -n \
+               qmt.$FSNAME-QMT0000.dt-0x0.soft_least_qunit)
 
        setup_quota_test
        stack_trap cleanup_quota_test EXIT
@@ -1301,8 +1303,11 @@ test_block_soft() {
 
        log "Write after timer goes off"
        # maybe cache write, ignore.
-       $RUNAS dd if=/dev/zero of=$testfile bs=1K count=10 seek=$OFFSET || true
-       OFFSET=$((OFFSET + 1024))
+       # write up to soft least quint to consume all
+       # possible slave granted space.
+       $RUNAS dd if=/dev/zero of=$testfile bs=1K \
+               count=$soft_limit seek=$OFFSET || true
+       OFFSET=$((OFFSET + soft_limit))
        cancel_lru_locks osc
        log "Write after cancel lru locks"
        $RUNAS dd if=/dev/zero of=$testfile bs=1K count=10 seek=$OFFSET &&