Whamcloud - gitweb
LU-16408 tests: fix replay-dual test 33 34/50434/10
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Mon, 27 Mar 2023 10:14:34 +0000 (12:14 +0200)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Sep 2023 06:02:34 +0000 (06:02 +0000)
Client can be evicted in REPLAY_LOCK. Wait REPLAY_WAIT import state
before aborting the recovery on the MDS.

When unmounting a combined MDT and MGT, the imperative recovery is
disabled. So, we have to force update the client import states
(MGC/MDC).

Test-Parameters: trivial
Test-Parameters: testlist=replay-dual env=ONLY="33",ONLY_REPEAT=50
Test-Parameters: testlist=replay-dual
Test-Parameters: testlist=replay-dual
Test-Parameters: testlist=replay-dual
Test-Parameters: testlist=replay-dual
Fixes: 1a79d395dd ("LU-15935 target: keep track of multirpc slots in last_rcvd")
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I0869fe968a18795dae39cf39a7009cf444820017
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50434
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/replay-dual.sh
lustre/tests/test-framework.sh

index 693a299..85836e6 100755 (executable)
@@ -1278,9 +1278,20 @@ test_33() { # LU-15935
 
        [[ "$mds1_FSTYPE" == "ldiskfs" ]] || skip "ldiskfs only test"
 
+       local at_min_old
+       at_min_old=$(at_min_get ost1)
+       at_min_set 60 ost
+       stack_trap "at_min_set $at_min_old ost"
+
+       # Clean old locks
+       cancel_lru_locks mdc
+
        clients_up
        stop mds1
 
+       # No IR -> force the update of mdc state
+       ! combined_mgs_mds || $LCTL get_param mdc.*.ping || true
+
        # check for OBD_INCOMPAT_MULTI_RPCS (0x400) in last_rcvd
        last_rcvd_check_incompat_flag mds1 0x400 ||
                error "1st failover: OBD_INCOMPAT_MULTI_RPCS is not set on MDT0000 last_rcvd"
@@ -1289,18 +1300,25 @@ test_33() { # LU-15935
        umount -f $MOUNT2
 
        mount_facet mds1
-       wait_clients_import_state "$HOSTNAME" mds1 "\(REPLAY_WAIT\|REPLAY_LOCKS\)"
+       wait_clients_import_state "$HOSTNAME" mds1 "REPLAY_WAIT"
 
        do_facet mds1 $LCTL --device $(convert_facet2label mds1) abort_recovery
        wait_clients_import_state "$HOSTNAME" mds1 "FULL"
+       wait_recovery_complete mds1
+       sleep 5
        stop mds1
 
        last_rcvd_check_incompat_flag mds1 0x400 ||
                error "2sd failover: OBD_INCOMPAT_MULTI_RPCS is not set on MDT0000 last_rcvd"
 
        mount_facet mds1
-       zconf_mount $HOSTNAME $MOUNT2
+
+       # No IR -> force the update of mgc state
+       ! combined_mgs_mds || $LCTL get_param mgc.*.ping || true
+
+       zconf_mount $HOSTNAME $MOUNT2 || error "Fail to mount $MOUNT2"
        wait_clients_import_state "$HOSTNAME" mds1 "FULL"
+       wait_recovery_complete mds1
 }
 run_test 33 "Check for OBD_INCOMPAT_MULTI_RPCS in last_rcvd after abort_recovery"
 
index 7abd208..54e5f35 100755 (executable)
@@ -6352,6 +6352,29 @@ at_max_set() {
        do_nodes $hosts lctl set_param at_max=$at_max
 }
 
+at_min_get() {
+       at_get $1 at_min
+}
+
+at_min_set() {
+       local at_min=$1
+       shift
+
+       local facet
+       local hosts
+
+       for facet in "$@"; do
+               if [ $facet == "ost" ]; then
+                       facet=$(get_facets OST)
+               elif [ $facet == "mds" ]; then
+                       facet=$(get_facets MDS)
+               fi
+               hosts=$(expand_list $hosts $(facets_hosts $facet))
+       done
+
+       do_nodes $hosts lctl set_param at_min=$at_min
+}
+
 ##################################
 # OBD_FAIL funcs