From 7f89e8c8975fcc82983c5756438861d66e64ec23 Mon Sep 17 00:00:00 2001 From: Etienne AUJAMES Date: Mon, 27 Mar 2023 12:14:34 +0200 Subject: [PATCH] LU-16408 tests: fix replay-dual test 33 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 Change-Id: I0869fe968a18795dae39cf39a7009cf444820017 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50434 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/tests/replay-dual.sh | 22 ++++++++++++++++++++-- lustre/tests/test-framework.sh | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index 693a299..85836e68b 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -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" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 7abd2083..54e5f35 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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 -- 1.8.3.1