Whamcloud - gitweb
LU-9820 osd-ldiskfs: OI scrub speed limit fix 91/40591/3
authorLai Siyao <lai.siyao@whamcloud.com>
Tue, 10 Nov 2020 02:44:17 +0000 (10:44 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Feb 2021 08:22:33 +0000 (08:22 +0000)
The OI scrub speed limit is set at start time, and shouldn't be
changed in the middle, otherwise lfsck is run with speed control,
while OI scrub may finish before it, thus sanity-scrub 9 failed.

Allow wider margin in speed control since the speed control is
heuristic.

Test-Parameters: testlist=sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub,sanity-scrub
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I995679db085a193c71fc7914f961b538b5930c69
Reviewed-on: https://review.whamcloud.com/40591
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_scrub.c
lustre/tests/sanity-scrub.sh

index 60da375..866dd04 100644 (file)
@@ -339,12 +339,6 @@ iget:
                                GOTO(out, rc = 0);
                }
 
-               if (!scrub->os_partial_scan) {
-                       spin_lock(&scrub->os_lock);
-                       scrub->os_full_speed = 1;
-                       spin_unlock(&scrub->os_lock);
-               }
-
                switch (val) {
                case SCRUB_NEXT_NOLMA:
                        sf->sf_flags |= SF_UPGRADE;
index 97d3e36..3a90dc0 100644 (file)
@@ -911,6 +911,7 @@ test_9() {
        sleep $RUN_TIME1
        scrub_check_status 6 completed
        scrub_check_flags 7 ""
+
        # OI scrub should run with limited speed under non-inconsistent case
        scrub_start 8 -s $BASE_SPEED1 -r
 
@@ -943,16 +944,17 @@ test_9() {
        done
        sleep $RUN_TIME2
 
-       # MIN_MARGIN = 0.8 = 8 / 10
+       # 30% margin
+       local MARGIN=3
        local MIN_SPEED=$(((PRE_FETCHED + \
                            BASE_SPEED1 * (RUN_TIME1 - TIME_DIFF) + \
                            BASE_SPEED2 * (RUN_TIME2 - TIME_DIFF)) / \
-                          (RUN_TIME1 + RUN_TIME2) * 8 / 10))
+                          (RUN_TIME1 + RUN_TIME2) * (10 - MARGIN) / 10))
        # MAX_MARGIN = 1.2 = 12 / 10
        MAX_SPEED=$(((PRE_FETCHED + \
                      BASE_SPEED1 * (RUN_TIME1 + TIME_DIFF) + \
                      BASE_SPEED2 * (RUN_TIME2 + TIME_DIFF)) / \
-                    (RUN_TIME1 + RUN_TIME2) * 12 / 10))
+                    (RUN_TIME1 + RUN_TIME2) * (10 + MARGIN) / 10))
        for n in $(seq $MDSCOUNT); do
                SPEED=$(scrub_status $n | awk '/^average_speed/ { print $2 }')
                [ $SPEED -gt $MIN_SPEED ] ||