From 240938f7b1fbd41fdf4cedc0650faeef873298c7 Mon Sep 17 00:00:00 2001 From: Alexander Boyko Date: Thu, 12 May 2022 09:49:34 -0400 Subject: [PATCH] LU-8367 tests: cleanup_orphans hang reproducer The patch adds recovery-small 144 test to reproduce hang at osp_precreate_cleanup_orphans(). PID: 49938 TASK: ffff98c63a248000 CPU: 30 COMMAND: "osp-pre-3-1" __schedule at ffffffff8e54e1d4 schedule at ffffffff8e54e648 osp_precreate_cleanup_orphans at ffffffffc17d00e9 [osp] osp_precreate_thread at ffffffffc17d18da [osp] Test-Parameters: trivial testlist=recovery-small env=ONLY=144b HPE-bug-id: LUS-10793 Signed-off-by: Alexander Boyko Change-Id: I463c75e63043c71ed0de0c6d08294098099c67e5 Reviewed-on: https://review.whamcloud.com/46939 Reviewed-by: Alexander Zarochentsev Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sergey Cheremencev Reviewed-by: Oleg Drokin --- lustre/tests/recovery-small.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 438b854..9aeb52e 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -3129,6 +3129,43 @@ test_144a() { } run_test 144a "MDT failover should stop precreation threads" +test_144b() { + [[ $($LCTL get_param mdc.*.import) =~ connect_flags.*overstriping ]] || + skip "server does not support overstriping" + + local pids="" + local rc=0 + local setcount=1000 + local mds_timeout + + large_xattr_enabled || skip_env "ea_inode feature disabled" + test_mkdir -i 0 -c 1 -p $DIR/$tdir + stack_trap "rm -rf $DIR/$tdir" EXIT + + mds_timeout=$(do_facet mds1 $LCTL get_param -n timeout) + do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param timeout=300 + stack_trap "do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param timeout=$mds_timeout" EXIT + + $LFS setstripe -i 0 -C $setcount $DIR/$tdir || error "setstripe failed" + + for (( i = 0; i < 50; i++)); do + touch $DIR/$tdir/$tfile_$i & + pids="$pids $!" + done + + fail ost1 + sleep 60 + + for pid in $pids; do + ps -p $pid > /dev/null + (( $? == 0 )) && rc=1 + kill -9 $pid >/dev/null 2>&1 + done + echo "rc $rc" + (( $rc == 0 )) || { fail mds1; error "Create thread still running"; } +} +run_test 144b "orphan cleanup shouldn't be blocked for no objects+failover situation" + test_145() { [ $MDSCOUNT -lt 3 ] && skip "needs >= 3 MDTs" [ $(facet_active_host mds2) = $(facet_active_host mds3) ] && -- 1.8.3.1