Whamcloud - gitweb
LU-17385 tests: sanity-lfsck 23d fix and enable 91/53591/4
authorAlexander Zarochentsev <alexander.zarochentsev@hpe.com>
Thu, 4 Jan 2024 19:07:18 +0000 (19:07 +0000)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Feb 2024 08:25:52 +0000 (08:25 +0000)
lfsck "-t layout -o" requests lfsck runs on all MTDs,
the test needs to wait them all before the next
test starts.

Test-Parameters: trivial testlist=sanity-lfsck mdscount=2 mdtcount=4
Test-Parameters: trivial testlist=sanity-lfsck mdscount=2 mdtcount=4
Test-Parameters: trivial testlist=sanity-lfsck mdscount=2 mdtcount=4
Test-Parameters: trivial testlist=sanity-lfsck mdscount=2 mdtcount=4
Signed-off-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Change-Id: Ida0bf876b60a73258a5a9bf392f96383c88adcb9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53591
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Alex Deiter
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-lfsck.sh

index 3e49078..3f5f68b 100755 (executable)
@@ -15,7 +15,7 @@ init_logging
 
 # bug number for skipped test:
 ALWAYS_EXCEPT="$SANITY_LFSCK_EXCEPT "
-always_except LU-17385 23d
+# always_except
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
@@ -4239,10 +4239,13 @@ test_23d() {
 
        do_facet mds1 $LCTL lfsck_start -M ${FSNAME}-MDT0000 -t layout -o ||
                error "lfsck namespace failed to start"
-       wait_update_facet mds1 "$LCTL get_param -n \
-               mdd.${FSNAME}-MDT0000.lfsck_layout |
-               awk '/^status/ { print \\\$2 }'" "completed" 32 ||
-                       error " unexpected lfsck status"
+
+       # lfsck -t layout -o broadcasts all MDTs to perform lfsck layout,
+       # wait them all
+       local count=$(do_facet mds1 $LCTL lfsck_query -t layout -w |
+               awk '/layout_mdts_completed:/ { print $2 }')
+       (( count != MDSCOUNT )) &&
+               error "Only $count/$MDSCOUNT lfsck completed"
 
        cmp $DIR/$tdir/mdt1dir/foo <(echo "b-a-r") || error "file body has changed"
 }