From: Alex Zhuravlev Date: Tue, 28 Sep 2021 17:04:36 +0000 (+0300) Subject: LU-15011 tests: additional checks for pool spilling X-Git-Tag: 2.15.53~93 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F74%2F45074%2F15;p=fs%2Flustre-release.git LU-15011 tests: additional checks for pool spilling check that spilling is not used when it's enough space Signed-off-by: Alex Zhuravlev Change-Id: If01bf0d03b73c5c985af5a784096356e723cbf0c Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/45074 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alexandre Ioffe Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/ost-pools.sh b/lustre/tests/ost-pools.sh index 5796c27..c7af35b 100755 --- a/lustre/tests/ost-pools.sh +++ b/lustre/tests/ost-pools.sh @@ -1586,10 +1586,12 @@ test_28() { } run_test 28 "lfs_migrate with pool name" +fill_ost_pool_cnt=0 + function fill_ost_pool() { local pool=$1 local threshold=$2 - local tmpfile=$DIR/$tdir/$tfile-$pool-filler + local tmpfile=$DIR/$tdir/$tfile-$pool-filler-$fill_ost_pool_cnt mkdir -p $DIR/$tdir lfs setstripe $tmpfile -p $pool -c -1 @@ -1604,13 +1606,16 @@ function fill_ost_pool() { fallocate -l$((towrite * 1024)) $tmpfile || error "can't fallocate" } + echo ">> filled to $threshold" + ((fill_ost_pool_cnt++)) } test_29() { local pool1=${TESTNAME}-1 local pool2=${TESTNAME}-2 - local threshold=10 - local prefix="lod.$FSNAME-MDT0000*.pool.$pool1" + local mdts=$(comma_list $(mdts_nodes)) + local threshold=20 + local prefix="lod.$FSNAME-MDT0000-mdtlov.pool.$pool1" local cmd="$LCTL get_param -n $prefix" local before local after @@ -1622,6 +1627,8 @@ test_29() { mkdir_on_mdt0 $DIR/$tdir stack_trap "rm -rf $DIR/$tdir" + local delay=$(do_facet mds1 lctl get_param -n lo[vd].*.qos_maxage | + awk '{ print $1 * 2; exit; }') pool_add $pool1 || error "Pool creation failed" pool_add_targets $pool1 0 1 || error "pool_add_targets failed" @@ -1633,18 +1640,52 @@ test_29() { do_facet mds1 $LCTL set_param $prefix.spill_threshold_pct=$threshold stack_trap "do_facet mds1 $LCTL set_param $prefix.spill_threshold_pct=0" - [[ $(do_facet mds1 "$cmd.spill_target") == "$pool2" ]] || - error "spill target wasn't set" - [[ $(do_facet mds1 "$cmd.spill_threshold_pct") == "$threshold" ]] || + [[ $(do_facet mds1 "$cmd.spill_target" | uniq) == "$pool2" ]] || + error "spill target wasn't set to $pool2" + [[ $(do_facet mds1 "$cmd.spill_threshold_pct" | uniq) == "$threshold" ]] || error "spill threshold wasn't set" before=$(do_facet mds1 "$cmd.spill_hit") lfs_df -p $pool1 | grep summary + + mkdir -p $DIR/$tdir + stack_trap "rm -rf $DIR/$tdir" + $LFS setstripe -p $pool1 $DIR/$tdir || error "can't set default layout" + + echo "check status with empty $pool1" + sleep $((delay + 1)) + [[ $(do_nodes $mdts $cmd.spill_is_active | uniq) == "0" ]] || { + do_nodes $mdts $cmd.spill_is_active + error "spilling on $pool1 is on" + } + touch $DIR/$tdir/$tfile-5 + [[ $($LFS getstripe -p $DIR/$tdir/$tfile-5) == "$pool1" ]] || { + $LFS getstripe $DIR/$tdir/$tfile-5 + error "not old pool on $tfile-5" + } + + echo "check with non-empty $pool1" + fill_ost_pool $pool1 $((threshold / 2)) + cancel_lru_locks osc + sleep $((delay + 1)) + lfs_df -p $pool1 | grep summary + [[ $(do_nodes $mdts $cmd.spill_is_active | uniq) == "0" ]] || { + do_nodes $mdts $cmd.spill_is_active + error "spilling on $pool1 is on" + } + touch $DIR/$tdir/$tfile-4 + [[ $($LFS getstripe -p $DIR/$tdir/$tfile-4) == "$pool1" ]] || { + $LFS getstripe $DIR/$tdir/$tfile-4 + error "new pool on $tfile-4" + } + fill_ost_pool $pool1 $threshold cancel_lru_locks osc - local delay=$(do_facet mds1 lctl get_param -n lo[vd].*.qos_maxage | - awk '{ print $1 * 2; exit; }') sleep $((delay + 1)) lfs_df -p $pool1 | grep summary + [[ $(do_nodes $mdts $cmd.spill_is_active | uniq) == "1" ]] || { + do_nodes $mdts $cmd.spill_is_active + error "spilling on $pool1 is off" + } # in a directory with default striping $LFS setstripe -p $pool1 $DIR/$tdir || error "can't set default layout"