From a71382df0204fe2cd465eba3873574118f46622b Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Mon, 28 Dec 2020 10:33:24 +0800 Subject: [PATCH] LU-14279 test: fix block soft testing failure 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 Change-Id: Ia221d97d158a8da4dc1fe1611aebac2f5086440e Reviewed-on: https://review.whamcloud.com/41094 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Hongchao Zhang Reviewed-by: Sergey Cheremencev Reviewed-by: Oleg Drokin --- lustre/tests/sanity-quota.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 5b07fa3..f876f20 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -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 && -- 1.8.3.1