Whamcloud - gitweb
LU-12706 tests: sanity-quota 4a sync timeout fix 10/56910/2
authorSergey Cheremencev <scherementsev@ddn.com>
Wed, 6 Nov 2024 20:56:58 +0000 (12:56 -0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Nov 2024 17:43:09 +0000 (17:43 +0000)
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, 15669105271566910563

Lustre-change: https://review.whamcloud.com/55216
Lustre-commit: 9e7b239bbd26b601127073bb0c6789cb9def7073

Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com>
Change-Id: I525e6c73c6d14a126a2bde7d92bc28f11f3c78c8
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56910
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-quota.sh
lustre/tests/test-framework.sh

index 6578ff9..0c3c4fe 100755 (executable)
@@ -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
index 8881e49..a8cf956 100755 (executable)
@@ -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}