Whamcloud - gitweb
LU-2225 tests: sanity/27 tests to poll for state 88/4388/10
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 29 Apr 2019 15:30:24 +0000 (18:30 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 2 Jun 2020 04:37:30 +0000 (04:37 +0000)
- 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 <bzzz@whamcloud.com>
Change-Id: I97366cb046c50223020f2161603657056a602cd5
Reviewed-on: https://review.whamcloud.com/4388
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
lustre/tests/sanity.sh

index c9ee46e..e07a051 100755 (executable)
@@ -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() {