From a0d53dc4c2406a12d1f50becf5970b4abe769d2a Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 22 Nov 2023 18:29:08 -0700 Subject: [PATCH] EX-8671 tests: use smaller files in sanity-pcc/103+104 Running fallocate is fast, but the actual PCC data copy may be slow. Use smaller test files for sanity-pcc test_103 and test_104 to speed up testing, and also wait longer in case the copy is slow. Add some extra debugging on failure so we can see the file attach state on failure, in case there is something wrong with the parsing. Test-Parameters: trivial testlist=sanity-pcc Test-Parameters: testlist=sanity-pcc env=ONLY=103,ONLY_REPEAT=100 Test-Parameters: testlist=sanity-pcc env=ONLY=104,ONLY_REPEAT=100 Signed-off-by: Andreas Dilger Change-Id: I09f159810a778b8ef2bab93d0e2869237a3ebbe5 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53212 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Feng Lei --- lustre/tests/sanity-pcc.sh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lustre/tests/sanity-pcc.sh b/lustre/tests/sanity-pcc.sh index 09ba79f..5fe3b0c 100755 --- a/lustre/tests/sanity-pcc.sh +++ b/lustre/tests/sanity-pcc.sh @@ -199,7 +199,7 @@ umount_loopdev() { if do_facet $facet lsof $mntpt; then echo "$mntpt is busy, wait 1 second..." sleep 1 - else + elif ((i > 1)); then echo "$mntpt is idle now" break fi @@ -210,20 +210,21 @@ umount_loopdev() { return $rc } +export PCC_MKFS_OPTS=${PCC_MKFS_OPTS:-"-E lazy_journal_init,lazy_itable_init"} setup_loopdev() { local facet=$1 local file=$2 local mntpt=$3 local size=${4:-50} + do_facet $facet $UMOUNT $mntpt do_facet $facet mkdir -p $mntpt || error "mkdir -p $mntpt failed" stack_trap "do_facet $facet rmdir $mntpt" EXIT - do_facet $facet dd if=/dev/zero of=$file bs=1M count=$size + do_facet $facet dd if=/dev/zero of=$file bs=1M seek=$((size-1)) count=1 stack_trap "do_facet $facet rm -f $file" EXIT - do_facet $facet mount - do_facet $facet $UMOUNT $mntpt - do_facet $facet mount - do_facet $facet mkfs.ext4 $file || error "mkfs.ext4 $file failed" + do_facet $facet mount | grep -E "$file|$mntpt|lustre|ext4" + do_facet $facet mkfs.ext4 $PCC_MKFS_OPTS $file || + error "mkfs.ext4 $file failed" local mcs=$(do_facet $facet tune2fs -l $file |& grep metadata_csum_seed) [[ -z "$mcs" ]] || do_facet $facet "tune2fs -O ^metadata_csum_seed $file" || @@ -3330,9 +3331,11 @@ wait_readonly_attach_fini() { local facet=${2:-$SINGLEAGT} local cmd="$LFS pcc state $file | grep -E -c 'type: readonly'" - echo $cmd - wait_update_facet $facet "$cmd" "1" 50 || + do_facet $facet $LFS pcc state $file + wait_update_facet $facet "$cmd" "1" 100 || { + do_facet $facet $LFS pcc state $file error "Async attach $file timed out" + } } calc_stats_facet() { @@ -4855,7 +4858,7 @@ test_103() { "projid={100}\ roid=$HSM_ARCHIVE_NUMBER\ pccro=1" $LFS setstripe -c -1 $file || error "failed to setstripe $file" - fallocate -l 200M $file || error "fallocate $file failed" + fallocate -l 50M $file || error "fallocate $file failed" stack_trap "rm -f $file" cancel_lru_locks osc $LFS pcc attach -i $HSM_ARCHIVE_NUMBER -A $file || @@ -4886,8 +4889,11 @@ test_104() { setup_pcc_mapping client \ "projid={0}\ roid=$HSM_ARCHIVE_NUMBER\ pccro=1" + local thresh=($($LCTL get_param -n llite.$FSNAME-*.pcc_async_threshold)) + stack_trap "$LCTL set_param llite.*.pcc_async_threshold=${thresh[0]}" + $LCTL set_param llite.*.pcc_async_threshold=80M $LFS setstripe -c -1 $file || error "failed to setstripe $file" - fallocate -l 500M $file || error "fallocate $file failed" + fallocate -l 100M $file || error "fallocate $file failed" stack_trap "rm -f $file" cancel_lru_locks osc # $LFS pcc attach will call realpath(): -- 1.8.3.1