From 5b8450f74ba1ae4b1c2901239fa02227194165c2 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Mon, 29 Apr 2019 18:30:24 +0300 Subject: [PATCH] LU-2225 tests: sanity/27 tests to poll for state - reset_enospc() to poll when precreate_status is OK - exhaust_precreations() to wait one time, not for every OST ONLY=27 OSTCOUNT=7 sh sanity: 641 sec before and 373 sec after Test-Parameters: trivial testlist=sanity fstype=zfs Signed-off-by: Alex Zhuravlev Change-Id: I97366cb046c50223020f2161603657056a602cd5 Reviewed-on: https://review.whamcloud.com/4388 Reviewed-by: Andreas Dilger Tested-by: Maloo Tested-by: jenkins Reviewed-by: Wei Liu --- lustre/tests/sanity.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index c9ee46e..e07a051 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -1780,17 +1780,24 @@ run_test 27m "create file while OST0 was full" # OSCs keep a NOSPC flag that will be reset after ~5s (qos_maxage) # if the OST isn't full anymore. reset_enospc() { - local OSTIDX=${1:-""} + local ostidx=${1:-""} + local delay + local ready + local get_prealloc local list=$(comma_list $(osts_nodes)) - [ "$OSTIDX" ] && list=$(facet_host ost$((OSTIDX + 1))) + [ "$ostidx" ] && list=$(facet_host ost$((ostidx + 1))) do_nodes $list lctl set_param fail_loc=0 - sync # initiate all OST_DESTROYs from MDS to OST - sleep_maxage + wait_delete_completed # initiate all OST_DESTROYs from MDS to OST + delay=$(do_facet $SINGLEMDS lctl get_param -n lov.*.qos_maxage | + awk '{print $1 * 2;exit;}') + get_prealloc="$LCTL get_param -n osc.*MDT*.prealloc_status | + grep -v \"^0$\"" + wait_update_facet $SINGLEMDS "$get_prealloc" "" $delay } -exhaust_precreations() { +__exhaust_precreations() { local OSTIDX=$1 local FAILLOC=$2 local FAILIDX=${3:-$OSTIDX} @@ -1821,14 +1828,19 @@ exhaust_precreations() { createmany -o $DIR/$tdir/${OST}/f $next_id $((last_id - next_id + 2)) do_facet $mfacet lctl get_param osp.$mdtosc_proc2.prealloc* do_facet $ofacet lctl set_param fail_loc=$FAILLOC +} + +exhaust_precreations() { + __exhaust_precreations $1 $2 $3 sleep_maxage } exhaust_all_precreations() { local i for (( i=0; i < OSTCOUNT; i++ )) ; do - exhaust_precreations $i $1 -1 + __exhaust_precreations $i $1 -1 done + sleep_maxage } test_27n() { -- 1.8.3.1