From cfbd77e4cd349f9414552e80e9f78f427ab13b53 Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Mon, 6 Apr 2015 12:16:53 -0700 Subject: [PATCH] LU-5579 tests: Add test for resend enqueue vs lock destroy This test is split out from the actual patch because some other test infrastructure issues make it always fail right now. Xyratex-bug-id: MRP-2094 Signed-off-by: Vitaly Fertman Signed-off-by: Oleg Drokin Signed-off-by: Liang Zhen Change-Id: I6f764fd863d6046bde8c6336f003e602fc07e59f Reviewed-on: http://review.whamcloud.com/12210 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Jian Yu --- lustre/mdt/mdt_handler.c | 2 +- lustre/tests/recovery-small.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index c038629..aa702f8 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -1434,11 +1434,11 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info, if (unlikely(IS_ERR(child))) GOTO(out_parent, rc = PTR_ERR(child)); + OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_RESEND, obd_timeout * 2); rc = mdt_check_resent_lock(info, child, lhc); if (rc < 0) { GOTO(out_child, rc); } else if (rc > 0) { - OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_RESEND, obd_timeout*2); mdt_lock_handle_init(lhc); mdt_lock_reg_init(lhc, LCK_PR); try_layout = false; diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index ca9318c..c486dd7 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -1362,6 +1362,39 @@ run_test 61 "Verify to not reuse orphan objects - bug 17025" #} #run_test 62 "Verify connection flags race - bug LU-1716" +test_66() +{ + [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.51) ]] || + { skip "Need MDS version at least 2.7.51"; return 0; } + + local list=$(comma_list $(osts_nodes)) + + # modify dir so that next revalidate would not obtain UPDATE lock + touch $DIR + + # drop 1 reply with UPDATE lock + mcreate $DIR/$tfile || error "mcreate failed: $?" + drop_ldlm_reply_once "stat $DIR/$tfile" & + sleep 2 + + # make the re-sent lock to sleep +#define OBD_FAIL_MDS_RESEND 0x136 + do_nodes $list $LCTL set_param fail_loc=0x80000136 + + #initiate the re-connect & re-send + local mdccli=$($LCTL dl | awk '/-mdc-/ {print $4;}') + local conn_uuid=$($LCTL get_param -n mdc.${mdccli}.mds_conn_uuid) + $LCTL set_param "mdc.${mdccli}.import=connection=${conn_uuid}" + sleep 2 + + #initiate the client eviction while enqueue re-send is in progress + mds_evict_client + + client_reconnect + wait +} +run_test 66 "lock enqueue re-send vs client eviction" + check_cli_ir_state() { local NODE=${1:-$HOSTNAME} -- 1.8.3.1