From 9e7b239bbd26b601127073bb0c6789cb9def7073 Mon Sep 17 00:00:00 2001 From: Sergey Cheremencev Date: Tue, 28 May 2024 01:49:24 +0300 Subject: [PATCH] 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 Signed-off-by: Sergey Cheremencev Change-Id: I525e6c73c6d14a126a2bde7d92bc28f11f3c78c8 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55216 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- lustre/tests/sanity-quota.sh | 14 ++++++++++---- lustre/tests/test-framework.sh | 9 ++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 575313a..68ba28d 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -1799,6 +1799,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" @@ -1806,17 +1807,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" @@ -1832,7 +1836,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 @@ -1849,7 +1854,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 7c4b02e..69b598f 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -3536,13 +3536,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} -- 1.8.3.1