Whamcloud - gitweb
LU-17165 tests: fix recovery-small test_141 91/55591/2
authorSebastien Buisson <sbuisson@ddn.com>
Mon, 1 Jul 2024 09:01:54 +0000 (11:01 +0200)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Jul 2024 20:55:05 +0000 (20:55 +0000)
Wait for import generation change before counting the locks when the
MGS has been restarted. And to make things clearer, check lock count
on OST side.

Test-Parameters: trivial
Test-Parameters: mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 testlist=recovery-small env=ONLY=141,ONLY_REPEAT=20
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Ie9526aa38e3a669b7865516a296dfeed438a83f3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55591
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Deiter
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/recovery-small.sh

index 376e443..dd971ca 100755 (executable)
@@ -3033,6 +3033,7 @@ run_test 140b "local mount is excluded from recovery"
 test_141() {
        local oldc
        local newc
+       local oldgen
 
        [ "$PARALLEL" == "yes" ] && skip "skip parallel run"
        combined_mgs_mds || skip "needs combined MGS/MDT"
@@ -3040,12 +3041,17 @@ test_141() {
                skip "cannot run in local mode or from build tree"
 
        # some get_param have a bug to handle dot in param name
-       do_rpc_nodes $(facet_active_host $SINGLEMDS) cancel_lru_locks MGC
-       oldc=$(do_facet $SINGLEMDS $LCTL get_param -n \
+       oldgen=$(do_facet ost1 $LCTL get_param -n mgc.*.import |
+                awk '/generation:/{print $NF}')
+       do_rpc_nodes $(facet_active_host ost1) cancel_lru_locks MGC
+       oldc=$(do_facet ost1 $LCTL get_param -n \
                'ldlm.namespaces.MGC*.lock_count')
        fail $SINGLEMDS
-       do_rpc_nodes $(facet_active_host $SINGLEMDS) cancel_lru_locks MGC
-       newc=$(do_facet $SINGLEMDS $LCTL get_param -n \
+       wait_mgc_import_state ost1 FULL
+       wait_update_facet_cond ost1 "$LCTL get_param -n mgc.*.import |
+               awk '/generation:/{print}' | cut -d':' -f2" != " $oldgen"
+       do_rpc_nodes $(facet_active_host ost1) cancel_lru_locks MGC
+       newc=$(do_facet ost1 $LCTL get_param -n \
                'ldlm.namespaces.MGC*.lock_count')
 
        [ $oldc -eq $newc ] || error "mgc lost locks ($oldc != $newc)"