From: Sergey Cheremencev Date: Mon, 27 May 2024 22:49:24 +0000 (+0300) Subject: LU-12706 tests: sanity-quota 4a sync timeout fix X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b86c88383f07561d3c2965aee4061f60f6c4ea50;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/ex/lustre-release/+/55470 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Hongchao Zhang Reviewed-by: Andreas Dilger --- diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 2e6e54c..000e18c 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -1707,6 +1707,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" @@ -1714,17 +1715,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" @@ -1740,7 +1744,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 @@ -1757,7 +1762,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 4b36568..99bcf92 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -3333,13 +3333,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}