Whamcloud - gitweb
LU-5579 tests: Add test for resend enqueue vs lock destroy 10/12210/5
authorVitaly Fertman <vitaly_fertman@xyratex.com>
Mon, 6 Apr 2015 19:16:53 +0000 (12:16 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 25 Apr 2015 16:59:05 +0000 (16:59 +0000)
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 <vitaly_fertman@xyratex.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: I6f764fd863d6046bde8c6336f003e602fc07e59f
Reviewed-on: http://review.whamcloud.com/12210
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
lustre/mdt/mdt_handler.c
lustre/tests/recovery-small.sh

index c038629..aa702f8 100644 (file)
@@ -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));
 
        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) {
        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;
                 mdt_lock_handle_init(lhc);
                mdt_lock_reg_init(lhc, LCK_PR);
                try_layout = false;
index ca9318c..c486dd7 100755 (executable)
@@ -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"
 
 #}
 #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}
 check_cli_ir_state()
 {
         local NODE=${1:-$HOSTNAME}