From: Sergey Cheremencev Date: Wed, 6 Nov 2024 20:56:58 +0000 (-0800) Subject: LU-12706 tests: sanity-quota 4a sync timeout fix X-Git-Tag: 2.15.6-RC1~7 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9b8ca98c0cb9b61266fe0bd864dc264cbb08a3fa;p=fs%2Flustre-release.git LU-12706 tests: sanity-quota 4a sync timeout fix Don't sync all OSTs in a system - this might take too much time. Instead, set striping only on OST0000 and sync only MDTs and OST0000. This fix is against the following failure: FAIL: Passed grace time 20, 1566910527, 1566910563 Lustre-change: https://review.whamcloud.com/55216 Lustre-commit: 9e7b239bbd26b601127073bb0c6789cb9def7073 Signed-off-by: Sergey Cheremencev Change-Id: I525e6c73c6d14a126a2bde7d92bc28f11f3c78c8 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56910 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 6578ff9..0c3c4fe 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -1647,6 +1647,7 @@ test_file_soft() { qmt.$FSNAME-QMT0000.md-0x0.soft_least_qunit) setup_quota_test + $LFS setstripe -c 1 -i 0 $DIR/$tdir || error "setstripe failed" is_project_quota_supported && change_project -sp $TSTPRJID $DIR/$tdir echo "Create files to exceed soft limit" @@ -1654,17 +1655,20 @@ test_file_soft() { quota_error a $TSTUSR "create failure, but expect success" local trigger_time=$(date +%s) - sync_all_data || true + sync_all_data_mdts || true + do_facet ost1 "lctl set_param -n osd*.*OST0000.force_sync=1" local cur_time=$(date +%s) [ $(($cur_time - $trigger_time)) -ge $grace ] && error "Passed grace time $grace, $trigger_time, $cur_time" + echo "========= Passed grace time $grace, $trigger_time, $cur_time" echo "Create file before timer goes off" $RUNAS touch ${TESTFILE}_before || quota_error a $TSTUSR "failed create before timer expired," \ "but expect success. $trigger_time, $cur_time" - sync_all_data || true + sync_all_data_mdts || true + do_facet ost1 "lctl set_param -n osd*.*OST0000.force_sync=1" wait_grace_time $qtype "file" @@ -1680,7 +1684,8 @@ test_file_soft() { $RUNAS createmany -m ${TESTFILE}_after_3 $((SOFT_LIMIT + 1)) && quota_error a $TSTUSR "create after timer expired," \ "but expect EDQUOT" - sync_all_data || true + sync_all_data_mdts || true + do_facet ost1 "lctl set_param -n osd*.*OST0000.force_sync=1" $SHOW_QUOTA_USER $SHOW_QUOTA_GROUP @@ -1697,7 +1702,8 @@ test_file_soft() { $RUNAS touch ${TESTFILE}_xxx || quota_error a $TSTUSR "touch after timer stop failure," \ "but expect success" - sync_all_data || true + sync_all_data_mdts || true + do_facet ost1 "lctl set_param -n osd*.*OST0000.force_sync=1" # cleanup cleanup_quota_test diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 8881e49..a8cf956 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -3153,13 +3153,20 @@ wait_update_facet() { wait_update_cond $verbose $quiet $node "$check" "==" "$expect" $max_wait } -sync_all_data() { +sync_all_data_mdts() { do_nodes $(comma_list $(mdts_nodes)) \ "lctl set_param -n os[cd]*.*MDT*.force_sync=1" +} + +sync_all_data_osts() { do_nodes $(comma_list $(osts_nodes)) \ "lctl set_param -n osd*.*OS*.force_sync=1" 2>&1 | grep -v 'Found no match' } +sync_all_data() { + sync_all_data_mdts + sync_all_data_osts +} wait_zfs_commit() { local zfs_wait=${2:-5}