Whamcloud - gitweb
LU-7710 test: sync all clients in recovery-small 130[acb]
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index 8e75d0d..03ce07c 100755 (executable)
@@ -1996,8 +1996,8 @@ test_110g () {
 
        createmany -o $remote_dir/f 100
 
-       #define OBD_FAIL_MIGRATE_NET_REP        0x1702
-       do_facet mds$MDTIDX lctl set_param fail_loc=0x1702
+       #define OBD_FAIL_MIGRATE_NET_REP                0x1800
+       do_facet mds$MDTIDX lctl set_param fail_loc=0x1800
        $LFS migrate -m $MDTIDX $remote_dir || error "migrate failed"
        do_facet mds$MDTIDX lctl set_param fail_loc=0x0
 
@@ -2252,6 +2252,98 @@ test_113() {
 }
 run_test 113 "ldlm enqueue dropped reply should not cause deadlocks"
 
+T130_PID=0
+test_130_base() {
+       test_mkdir -p $DIR/$tdir
+
+       # Prevent interference from layout intent RPCs due to
+       # asynchronous writeback. These will be tested in 130c below.
+       do_nodes ${CLIENTS:-$HOSTNAME} sync
+
+       # get only LOOKUP lock on $tdir
+       cancel_lru_locks mdc
+       ls $DIR/$tdir/$tfile 2>/dev/null
+
+       # get getattr by fid on $tdir
+       #
+       # we need to race with unlink, unlink must complete before we will
+       # take a DLM lock, otherwise unlink will wait until getattr will
+       # complete; but later than getattr starts so that getattr found
+       # the object
+#define OBD_FAIL_MDS_INTENT_DELAY              0x160
+       set_nodes_failloc "$(mdts_nodes)" 0x80000160
+       stat $DIR/$tdir &
+       T130_PID=$!
+       sleep 2
+
+       rm -rf $DIR/$tdir
+
+       # drop the reply so that resend happens on an unlinked file.
+#define OBD_FAIL_MDS_LDLM_REPLY_NET     0x157
+       set_nodes_failloc "$(mdts_nodes)" 0x80000157
+}
+
+test_130a() {
+       remote_mds_nodsh && skip "remote MDS with nodsh" && return
+       test_130_base
+
+       wait $T130_PID || [ $? -eq 0 ] && error "stat should fail"
+       return 0
+}
+run_test 130a "enqueue resend on not existing file"
+
+test_130b() {
+       remote_mds_nodsh && skip "remote MDS with nodsh" && return
+       test_130_base
+       # let the reply to be dropped
+       sleep 10
+
+#define OBD_FAIL_SRV_ENOENT              0x217
+       set_nodes_failloc "$(mdts_nodes)" 0x80000217
+
+       wait $T130_PID || [ $? -eq 0 ] && error "stat should fail"
+       return 0
+}
+run_test 130b "enqueue resend on a stale inode"
+
+test_130c() {
+       remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
+       do_nodes ${CLIENTS:-$HOSTNAME} sync
+       echo XXX > $DIR/$tfile
+
+       cancel_lru_locks mdc
+
+       # Trigger writeback on $tfile.
+       #
+       # we need to race with unlink, unlink must complete before we will
+       # take a DLM lock, otherwise unlink will wait until intent will
+       # complete; but later than intent starts so that intent found
+       # the object
+#define OBD_FAIL_MDS_INTENT_DELAY              0x160
+       set_nodes_failloc "$(mdts_nodes)" 0x80000160
+       sync &
+       T130_PID=$!
+       sleep 2
+
+       rm $DIR/$tfile
+
+       # drop the reply so that resend happens on an unlinked file.
+#define OBD_FAIL_MDS_LDLM_REPLY_NET     0x157
+       set_nodes_failloc "$(mdts_nodes)" 0x80000157
+
+       # let the reply to be dropped
+       sleep 10
+
+#define OBD_FAIL_SRV_ENOENT              0x217
+       set_nodes_failloc "$(mdts_nodes)" 0x80000217
+
+       wait $T130_PID
+
+       return 0
+}
+run_test 130c "layout intent resend on a stale inode"
+
 complete $SECONDS
 check_and_cleanup_lustre
 exit_status