Whamcloud - gitweb
LU-13019 tests: replace usleep in test scripts
[fs/lustre-release.git] / lustre / tests / replay-single.sh
index b31596b..726d773 100755 (executable)
@@ -1,43 +1,21 @@
 #!/bin/bash
 
 set -e
-#set -v
-
-#
-# This test needs to be run on the client
-#
-SAVE_PWD=$PWD
-export MULTIOP=${MULTIOP:-multiop}
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-SETUP=${SETUP:-}
-CLEANUP=${CLEANUP:-}
+
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 init_logging
-CHECK_GRANT=${CHECK_GRANT:-"yes"}
-GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
-
-require_dsh_mds || exit 0
 
-# Skip these tests
-# bug number for skipped tests:
 ALWAYS_EXCEPT="$REPLAY_SINGLE_EXCEPT "
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
-# time in minutes:                 7.5"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="44b"
 
-if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then
-# bug number for skipped test: LU-11388
-       ALWAYS_EXCEPT+="131b"
-       if [ $MDSCOUNT -gt 1 ]; then
-# bug number for skipped test:   LU-10740 LU-11330 LU-9157 LU-11336
-               ALWAYS_EXCEPT+=" 2d       70d      80c     80d"
-       fi
+if [ "$mds1_FSTYPE" = zfs ]; then
+       # bug number for skipped test: LU-11388
+       ALWAYS_EXCEPT+="               131b"
+       # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 fi
 if $SHARED_KEY; then
-# bug number for skipped tests: LU-9795 (all below)
+       # bug number for skipped tests: LU-9795 (all below)
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT   0b      0c      0d      34      45"
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT   47      58b     58c     71a     85a"
        ALWAYS_EXCEPT="$ALWAYS_EXCEPT   85b     86      88      89      90"
@@ -46,6 +24,10 @@ fi
 
 build_test_filter
 
+CHECK_GRANT=${CHECK_GRANT:-"yes"}
+GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
+
+require_dsh_mds || exit 0
 check_and_setup_lustre
 
 mkdir -p $DIR
@@ -141,6 +123,9 @@ test_2c() {
 run_test 2c "setstripe replay"
 
 test_2d() {
+       [[ "$mds1_FSTYPE" = zfs ]] &&
+               [[ "$MDS1_VERSION" -lt $(version_code 2.12.51) ]] &&
+               skip "requires LU-10143 fix on MDS"
        replay_barrier $SINGLEMDS
        $LFS setdirstripe -i 0 -c $MDSCOUNT $DIR/$tdir
        fail $SINGLEMDS
@@ -488,7 +473,7 @@ test_20b() { # bug 10480
 
        dd if=/dev/zero of=$DIR/$tfile bs=4k count=10000 &
        while [ ! -e $DIR/$tfile ] ; do
-               usleep 60                       # give dd a chance to start
+               sleep 0.01                      # give dd a chance to start
        done
 
        $LFS getstripe $DIR/$tfile || error "$LFS getstripe $DIR/$tfile failed"
@@ -840,7 +825,7 @@ test_36() {
        checkstat $DIR/$tfile
        facet_failover $SINGLEMDS
        cancel_lru_locks mdc
-       if dmesg | grep "unknown lock cookie"; then
+       if $LCTL dk | grep "stale lock .*cookie"; then
                error "cancel after replay failed"
        fi
 }
@@ -860,7 +845,7 @@ test_37() {
        do_facet $SINGLEMDS dmesg -c >/dev/null
        fail_abort $SINGLEMDS
        kill -USR1 $pid || error "multiop $pid not running"
-       do_facet $SINGLEMDS dmesg | grep "error .* unlinking .* from PENDING" &&
+       do_facet $SINGLEMDS dmesg | grep "error unlinking orphan" &&
                error "error unlinking files"
        wait $pid || error "multiop $pid failed"
        sync
@@ -955,7 +940,7 @@ test_41() {
 
        local f=$MOUNT/$tfile
        # make sure the start of the file is ost1
-       $SETSTRIPE -S $((128 * 1024)) -i 0 $f
+       $LFS setstripe -S $((128 * 1024)) -i 0 $f
        do_facet client dd if=/dev/zero of=$f bs=4k count=1 ||
                error "dd on client failed"
        cancel_lru_locks osc
@@ -1118,12 +1103,12 @@ test_45() {
 run_test 45 "Handle failed close"
 
 test_46() {
-       dmesg -c >/dev/null
        drop_reply "touch $DIR/$tfile"
        fail $SINGLEMDS
        # ironically, the previous test, 45, will cause a real forced close,
        # so just look for one for this test
-       dmesg | grep -i "force closing client file handle for $tfile" &&
+       local FID=$($LFS path2fid $tfile)
+       $LCTL dk | grep -i "force closing file handle $FID" &&
                error "found force closing in dmesg"
        return 0
 }
@@ -1194,9 +1179,8 @@ run_test 50 "Double OSC recovery, don't LASSERT (3812)"
 
 # b3764 timed out lock replay
 test_52() {
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.90) ] &&
-               skip "MDS prior to 2.6.90 handle LDLM_REPLY_NET incorrectly" &&
-               return 0
+       [ "$MDS1_VERSION" -lt $(version_code 2.6.90) ] &&
+               skip "MDS prior to 2.6.90 handle LDLM_REPLY_NET incorrectly"
 
        touch $DIR/$tfile || error "touch $DIR/$tfile failed"
        cancel_lru_locks mdc
@@ -1837,7 +1821,7 @@ test_65a() #bug 3055
     createmany -o $DIR/$tfile 10 > /dev/null
     unlinkmany $DIR/$tfile 10 > /dev/null
     # check for log message
-    $LCTL dk | grep "Early reply #" || error "No early reply"
+    $LCTL dk | grep -i "Early reply #" || error "No early reply"
     debugrestore
     # client should show REQ_DELAY estimates
     lctl get_param -n mdc.${FSNAME}-MDT0000-mdc-*.timeouts | grep portal
@@ -1857,8 +1841,8 @@ test_65b() #bug 3055
        $LCTL dk > /dev/null
        # Slow down a request to the current service time, this is critical
        # because previous tests may have caused this value to increase.
-       $SETSTRIPE --stripe-index=0 --stripe-count=1 $DIR/$tfile ||
-               error "$SETSTRIPE failed for $DIR/$tfile"
+       $LFS setstripe --stripe-index=0 --stripe-count=1 $DIR/$tfile ||
+               error "$LFS setstripe failed for $DIR/$tfile"
 
        multiop $DIR/$tfile Ow1yc
        REQ_DELAY=`lctl get_param -n osc.${FSNAME}-OST0000-osc-*.timeouts |
@@ -1870,14 +1854,14 @@ test_65b() #bug 3055
        do_facet ost1 $LCTL set_param fail_loc=0x224
 
        rm -f $DIR/$tfile
-       $SETSTRIPE --stripe-index=0 --stripe-count=1 $DIR/$tfile ||
-               error "$SETSTRIPE failed"
+       $LFS setstripe --stripe-index=0 --stripe-count=1 $DIR/$tfile ||
+               error "$LFS setstripe failed"
        # force some real bulk transfer
        multiop $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c
 
        do_facet ost1 $LCTL set_param fail_loc=0
        # check for log message
-       $LCTL dk | grep "Early reply #" || error "No early reply"
+       $LCTL dk | grep -i "Early reply #" || error "No early reply"
        debugrestore
        # client should show REQ_DELAY estimates
        lctl get_param -n osc.${FSNAME}-OST0000-osc-*.timeouts | grep portal
@@ -1965,16 +1949,17 @@ test_67b() #bug 3055
     at_start || return 0
     CONN1=$(lctl get_param -n osc.*.stats | awk '/_connect/ {total+=$2} END {print total}')
 
-    # exhaust precreations on ost1
-    local OST=$(ostname_from_index 0)
-    local mdtosc=$(get_mdtosc_proc_path mds $OST)
-    local last_id=$(do_facet $SINGLEMDS lctl get_param -n \
-        osc.$mdtosc.prealloc_last_id)
-    local next_id=$(do_facet $SINGLEMDS lctl get_param -n \
-        osc.$mdtosc.prealloc_next_id)
+       # exhaust precreations on ost1
+       local OST=$(ostname_from_index 0)
+       local mdtosc=$(get_mdtosc_proc_path mds $OST)
+       local last_id=$(do_facet $SINGLEMDS lctl get_param -n \
+                       osp.$mdtosc.prealloc_last_id)
+       local next_id=$(do_facet $SINGLEMDS lctl get_param -n \
+                       osp.$mdtosc.prealloc_next_id)
 
        mkdir -p $DIR/$tdir/${OST} || error "mkdir $DIR/$tdir/${OST} failed"
-       $SETSTRIPE -i 0 -c 1 $DIR/$tdir/${OST} || error "$SETSTRIPE failed"
+       $LFS setstripe -i 0 -c 1 $DIR/$tdir/${OST} ||
+               error "$LFS setstripe failed"
        echo "Creating to objid $last_id on ost $OST..."
 #define OBD_FAIL_OST_PAUSE_CREATE        0x223
     do_facet ost1 "$LCTL set_param fail_val=20000"
@@ -2016,8 +2001,8 @@ test_68 () #bug 13813
        do_facet ost1 "echo $TIMEOUT >> $ldlm_enqueue_min_r"
 
        mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed"
-       $SETSTRIPE --stripe-index=0 -c 1 $DIR/$tdir ||
-               error "$SETSTRIPE failed for $DIR/$tdir"
+       $LFS setstripe --stripe-index=0 -c 1 $DIR/$tdir ||
+               error "$LFS setstripe failed for $DIR/$tdir"
        #define OBD_FAIL_LDLM_PAUSE_CANCEL       0x312
        $LCTL set_param fail_val=$(($TIMEOUT - 1))
        $LCTL set_param fail_loc=0x80000312
@@ -2382,7 +2367,8 @@ test_70f_loop(){
        DD_OPTS=
 
        mkdir -p $DIR/$tdir || error "cannot create $DIR/$tdir directory"
-       $SETSTRIPE -c -1 $DIR/$tdir || error "cannot $SETSTRIPE $DIR/$tdir"
+       $LFS setstripe -c -1 $DIR/$tdir ||
+               error "cannot $LFS setstripe $DIR/$tdir"
 
        touch $stopflag
        while [ -f $stopflag ]; do
@@ -2407,8 +2393,8 @@ test_70f() {
 #      [ $CLIENTCOUNT -lt 2 ] &&
 #              { skip "Need 2 or more clients, have $CLIENTCOUNT" && return; }
 
-       [[ $(lustre_version_code ost1) -lt $(version_code 2.9.53) ]] &&
-               skip "Need server version at least 2.9.53" && return
+       [[ "$OST1_VERSION" -lt $(version_code 2.9.53) ]] &&
+               skip "Need server version at least 2.9.53"
 
        echo "mount clients $CLIENTS ..."
        zconf_mount_clients $CLIENTS $MOUNT
@@ -2552,8 +2538,8 @@ test_73b() {
        rm -f $DIR/$tfile
 
        replay_barrier $SINGLEMDS
-       #define OBD_FAIL_LDLM_REPLY       0x30c
-       do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000030c"
+       #define OBD_FAIL_MDS_LDLM_REPLY_NET       0x157
+       do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000157"
        fail $SINGLEMDS
        kill -USR1 $pid
        wait $pid || error "multiop pid failed"
@@ -2653,11 +2639,13 @@ test_80b() {
 run_test 80b "DNE: create remote dir, drop update rep from MDT0, fail MDT1"
 
 test_80c() {
-       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
+       [[ "$mds1_FSTYPE" = zfs ]] &&
+               [[ $MDS1_VERSION -lt $(version_code 2.12.51) ]] &&
+               skip "requires LU-10143 fix on MDS"
+       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
        ([ $FAILURE_MODE == "HARD" ] &&
                [ "$(facet_host mds1)" == "$(facet_host mds2)" ]) &&
-               skip "MDTs needs to be on diff hosts for HARD fail mode" &&
-               return 0
+               skip "MDTs needs to be on diff hosts for HARD fail mode"
 
        local MDTIDX=1
        local remote_dir=$DIR/$tdir/remote_dir
@@ -2683,7 +2671,10 @@ test_80c() {
 run_test 80c "DNE: create remote dir, drop update rep from MDT1, fail MDT[0,1]"
 
 test_80d() {
-       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
+       [[ "$mds1_FSTYPE" = zfs ]] &&
+               [[ $MDS1_VERSION -lt $(version_code 2.12.51) ]] &&
+               skip "requires LU-10143 fix on MDS"
+       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
        local MDTIDX=1
        local remote_dir=$DIR/$tdir/remote_dir
 
@@ -3114,28 +3105,22 @@ test_85a() { #bug 16774
 run_test 85a "check the cancellation of unused locks during recovery(IBITS)"
 
 test_85b() { #bug 16774
-       lctl set_param -n ldlm.cancel_unused_locks_before_replay "1"
-
-       if ! combined_mgs_mds ; then
-               mount_mgs_client
-       fi
+       rm -rf $DIR/$tdir
+       mkdir $DIR/$tdir
 
-       create_pool $FSNAME.$TESTNAME ||
-               error "unable to create pool $TESTNAME"
-       do_facet mgs $LCTL pool_add $FSNAME.$TESTNAME $FSNAME-OST0000 ||
-               error "unable to add pool $TESTNAME"
+       lctl set_param -n ldlm.cancel_unused_locks_before_replay "1"
 
-       $SETSTRIPE -c 1 -p $FSNAME.$TESTNAME $DIR
+       $LFS setstripe -c 1 -i 0 $DIR/$tdir
 
        for i in $(seq 100); do
-               dd if=/dev/urandom of=$DIR/$tfile-$i bs=4096 \
+               dd if=/dev/urandom of=$DIR/$tdir/$tfile-$i bs=4096 \
                        count=32 >/dev/null 2>&1
        done
 
        cancel_lru_locks osc
 
        for i in $(seq 100); do
-               dd if=$DIR/$tfile-$i of=/dev/null bs=4096 \
+               dd if=$DIR/$tdir/$tfile-$i of=/dev/null bs=4096 \
                        count=32 >/dev/null 2>&1
        done
 
@@ -3152,18 +3137,11 @@ test_85b() { #bug 16774
                 -n ldlm.namespaces.*OST0000*$addr.lock_unused_count)
        echo "after recovery: unused locks count = $count2"
 
-       do_facet mgs $LCTL pool_remove $FSNAME.$TESTNAME $FSNAME-OST0000 ||
-               error "unable to remove pool $TESTNAME"
-       do_facet mgs $LCTL pool_destroy $FSNAME.$TESTNAME ||
-               error "unable to destroy the pool $TESTNAME"
-
-       if ! combined_mgs_mds ; then
-               umount_mgs_client
-       fi
-
        if [ $count2 -ge $count ]; then
                error "unused locks are not canceled"
        fi
+
+       rm -rf $DIR/$tdir
 }
 run_test 85b "check the cancellation of unused locks during recovery(EXTENT)"
 
@@ -3181,7 +3159,7 @@ test_87a() {
        do_facet ost1 "lctl set_param -n obdfilter.${ost1_svc}.sync_journal 0"
 
        replay_barrier ost1
-       $SETSTRIPE -i 0 -c 1 $DIR/$tfile
+       $LFS setstripe -i 0 -c 1 $DIR/$tfile
        dd if=/dev/urandom of=$DIR/$tfile bs=1024k count=8 ||
                error "dd to $DIR/$tfile failed"
        cksum=$(md5sum $DIR/$tfile | awk '{print $1}')
@@ -3199,7 +3177,7 @@ test_87b() {
        do_facet ost1 "lctl set_param -n obdfilter.${ost1_svc}.sync_journal 0"
 
        replay_barrier ost1
-       $SETSTRIPE -i 0 -c 1 $DIR/$tfile
+       $LFS setstripe -i 0 -c 1 $DIR/$tfile
        dd if=/dev/urandom of=$DIR/$tfile bs=1024k count=8 ||
                error "dd to $DIR/$tfile failed"
        sleep 1 # Give it a chance to flush dirty data
@@ -3219,16 +3197,16 @@ test_88() { #bug 17485
        mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed"
        mkdir -p $TMP/$tdir || error "mkdir $TMP/$tdir failed"
 
-       $SETSTRIPE -i 0 -c 1 $DIR/$tdir || error "$SETSTRIPE"
+       $LFS setstripe -i 0 -c 1 $DIR/$tdir || error "$LFS setstripe failed"
 
        replay_barrier ost1
        replay_barrier $SINGLEMDS
 
-    # exhaust precreations on ost1
-    local OST=$(ostname_from_index 0)
-    local mdtosc=$(get_mdtosc_proc_path $SINGLEMDS $OST)
-    local last_id=$(do_facet $SINGLEMDS lctl get_param -n osc.$mdtosc.prealloc_last_id)
-    local next_id=$(do_facet $SINGLEMDS lctl get_param -n osc.$mdtosc.prealloc_next_id)
+       # exhaust precreations on ost1
+       local OST=$(ostname_from_index 0)
+       local mdtosc=$(get_mdtosc_proc_path $SINGLEMDS $OST)
+       local last_id=$(do_facet $SINGLEMDS lctl get_param -n osp.$mdtosc.prealloc_last_id)
+       local next_id=$(do_facet $SINGLEMDS lctl get_param -n osp.$mdtosc.prealloc_next_id)
        echo "before test: last_id = $last_id, next_id = $next_id"
 
        echo "Creating to objid $last_id on ost $OST..."
@@ -3240,8 +3218,8 @@ test_88() { #bug 17485
        createmany -o $DIR/$tdir/f-%d $last_id 8 ||
                error "createmany create files with uncommitted objids failed"
 
-    last_id2=$(do_facet $SINGLEMDS lctl get_param -n osc.$mdtosc.prealloc_last_id)
-    next_id2=$(do_facet $SINGLEMDS lctl get_param -n osc.$mdtosc.prealloc_next_id)
+    last_id2=$(do_facet $SINGLEMDS lctl get_param -n osp.$mdtosc.prealloc_last_id)
+    next_id2=$(do_facet $SINGLEMDS lctl get_param -n osp.$mdtosc.prealloc_next_id)
     echo "before recovery: last_id = $last_id2, next_id = $next_id2" 
 
     # if test uses shutdown_facet && reboot_facet instead of facet_failover ()
@@ -3264,8 +3242,8 @@ test_88() { #bug 17485
 
     clients_up
 
-    last_id2=$(do_facet $SINGLEMDS lctl get_param -n osc.$mdtosc.prealloc_last_id)
-    next_id2=$(do_facet $SINGLEMDS lctl get_param -n osc.$mdtosc.prealloc_next_id)
+    last_id2=$(do_facet $SINGLEMDS lctl get_param -n osp.$mdtosc.prealloc_last_id)
+    next_id2=$(do_facet $SINGLEMDS lctl get_param -n osp.$mdtosc.prealloc_next_id)
        echo "after recovery: last_id = $last_id2, next_id = $next_id2"
 
        # create new files, which should use new objids, and ensure the orphan
@@ -3312,7 +3290,7 @@ test_89() {
        local blocks1=$(calc_osc_kbytes_used)
        local write_size=$(fs_log_size)
 
-       $SETSTRIPE -i 0 -c 1 $DIR/$tdir/$tfile
+       $LFS setstripe -i 0 -c 1 $DIR/$tdir/$tfile
        [ $write_size -lt 1024 ] && write_size=1024
        dd if=/dev/zero bs=${write_size}k count=10 of=$DIR/$tdir/$tfile
        sync
@@ -3426,9 +3404,9 @@ test_90() { # bug 19494
     [[ $(echo $list | wc -w) -eq 2 ]] ||
         error_noexit "lfs find reports the wrong list of affected files ${#list[@]}"
 
-    echo "Check getstripe: $GETSTRIPE -r --obd $obd"
-    list=$($GETSTRIPE -r --obd $obd $dir)
-    echo "$list"
+       echo "Check getstripe: $LFS getstripe -r --obd $obd"
+       list=$($LFS getstripe -r --obd $obd $dir)
+       echo "$list"
     for file in all f$index; do
         echo "$list" | grep $dir/$file ||
             error_noexit "lfs getsripe does not report the affected $obd for $file"
@@ -3439,16 +3417,15 @@ test_90() { # bug 19494
 run_test 90 "lfs find identifies the missing striped file segments"
 
 test_93a() {
-       local server_version=$(lustre_version_code $SINGLEMDS)
-               [[ $server_version -ge $(version_code 2.6.90) ]] ||
-               [[ $server_version -ge $(version_code 2.5.4) &&
-                  $server_version -lt $(version_code 2.5.50) ]] ||
-               { skip "Need MDS version 2.5.4+ or 2.6.90+"; return; }
+       [[ "$MDS1_VERSION" -ge $(version_code 2.6.90) ]] ||
+               [[ "$MDS1_VERSION" -ge $(version_code 2.5.4) &&
+                  "$MDS1_VERSION" -lt $(version_code 2.5.50) ]] ||
+               skip "Need MDS version 2.5.4+ or 2.6.90+"
 
        cancel_lru_locks osc
 
-       $SETSTRIPE -i 0 -c 1 $DIR/$tfile ||
-               error "$SETSTRIPE  $DIR/$tfile failed"
+       $LFS setstripe -i 0 -c 1 $DIR/$tfile ||
+               error "$LFS setstripe  $DIR/$tfile failed"
        dd if=/dev/zero of=$DIR/$tfile bs=1024 count=1 ||
                error "dd to $DIR/$tfile failed"
        #define OBD_FAIL_TGT_REPLAY_RECONNECT     0x715
@@ -3463,9 +3440,8 @@ test_93a() {
 run_test 93a "replay + reconnect"
 
 test_93b() {
-       local server_version=$(lustre_version_code $SINGLEMDS)
-               [[ $server_version -ge $(version_code 2.7.90) ]] ||
-               { skip "Need MDS version 2.7.90+"; return; }
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.90) ]] ||
+               skip "Need MDS version 2.7.90+"
 
        cancel_lru_locks mdc
 
@@ -3795,10 +3771,9 @@ test_102d() {
 run_test 102d "check replay & reconstruction with multiple mod RPCs in flight"
 
 test_103() {
-       remote_mds_nodsh && skip "remote MDS with nodsh" && return
-       local mds_version=$(lustre_version_code $SINGLEMDS)
-       [[ $mds_version -gt $(version_code 2.8.54) ]] ||
-               { skip "Need MDS version 2.8.54+"; return; }
+       remote_mds_nodsh && skip "remote MDS with nodsh"
+       [[ "$MDS1_VERSION" -gt $(version_code 2.8.54) ]] ||
+               skip "Need MDS version 2.8.54+"
 
 #define OBD_FAIL_MDS_TRACK_OVERFLOW 0x162
        do_facet mds1 $LCTL set_param fail_loc=0x80000162
@@ -3826,7 +3801,7 @@ check_striped_dir_110()
 
 test_110a() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -3848,7 +3823,7 @@ run_test 110a "DNE: create striped dir, fail MDT1"
 
 test_110b() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -3874,7 +3849,7 @@ run_test 110b "DNE: create striped dir, fail MDT1 and client"
 
 test_110c() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -3897,7 +3872,7 @@ run_test 110c "DNE: create striped dir, fail MDT2"
 
 test_110d() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -3923,7 +3898,7 @@ run_test 110d "DNE: create striped dir, fail MDT2 and client"
 
 test_110e() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -3950,7 +3925,7 @@ run_test 110e "DNE: create striped dir, uncommit on MDT2, fail client/MDT1/MDT2"
 
 test_110f() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -3974,7 +3949,7 @@ run_test 110f "DNE: create striped dir, fail MDT1/MDT2"
 
 test_110g() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4001,7 +3976,7 @@ run_test 110g "DNE: create striped dir, uncommit on MDT1, fail client/MDT1/MDT2"
 
 test_111a() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4023,7 +3998,7 @@ run_test 111a "DNE: unlink striped dir, fail MDT1"
 
 test_111b() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4048,7 +4023,7 @@ run_test 111b "DNE: unlink striped dir, fail MDT2"
 
 test_111c() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4073,7 +4048,7 @@ run_test 111c "DNE: unlink striped dir, uncommit on MDT1, fail client/MDT1/MDT2"
 
 test_111d() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4099,7 +4074,7 @@ run_test 111d "DNE: unlink striped dir, uncommit on MDT2, fail client/MDT1/MDT2"
 
 test_111e() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4121,7 +4096,7 @@ run_test 111e "DNE: unlink striped dir, uncommit on MDT2, fail MDT1/MDT2"
 
 test_111f() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4143,7 +4118,7 @@ run_test 111f "DNE: unlink striped dir, uncommit on MDT1, fail MDT1/MDT2"
 
 test_111g() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4188,7 +4163,7 @@ test_112_check() {
 
 test_112a() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4210,7 +4185,7 @@ run_test 112a "DNE: cross MDT rename, fail MDT1"
 
 test_112b() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4233,7 +4208,7 @@ run_test 112b "DNE: cross MDT rename, fail MDT2"
 
 test_112c() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4256,7 +4231,7 @@ run_test 112c "DNE: cross MDT rename, fail MDT3"
 
 test_112d() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4279,7 +4254,7 @@ run_test 112d "DNE: cross MDT rename, fail MDT4"
 
 test_112e() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4303,7 +4278,7 @@ run_test 112e "DNE: cross MDT rename, fail MDT1 and MDT2"
 
 test_112f() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4327,7 +4302,7 @@ run_test 112f "DNE: cross MDT rename, fail MDT1 and MDT3"
 
 test_112g() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4351,7 +4326,7 @@ run_test 112g "DNE: cross MDT rename, fail MDT1 and MDT4"
 
 test_112h() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4375,7 +4350,7 @@ run_test 112h "DNE: cross MDT rename, fail MDT2 and MDT3"
 
 test_112i() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4399,7 +4374,7 @@ run_test 112i "DNE: cross MDT rename, fail MDT2 and MDT4"
 
 test_112j() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4423,7 +4398,7 @@ run_test 112j "DNE: cross MDT rename, fail MDT3 and MDT4"
 
 test_112k() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4448,7 +4423,7 @@ run_test 112k "DNE: cross MDT rename, fail MDT1,MDT2,MDT3"
 
 test_112l() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4473,7 +4448,7 @@ run_test 112l "DNE: cross MDT rename, fail MDT1,MDT2,MDT4"
 
 test_112m() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4498,7 +4473,7 @@ run_test 112m "DNE: cross MDT rename, fail MDT1,MDT3,MDT4"
 
 test_112n() {
        [ $MDSCOUNT -lt 4 ] && skip "needs >= 4 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4523,7 +4498,7 @@ run_test 112n "DNE: cross MDT rename, fail MDT2,MDT3,MDT4"
 
 test_115() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.56) ]] ||
+       [[ "$MDS1_VERSION" -ge $(version_code 2.7.56) ]] ||
                skip "Need MDS version at least 2.7.56"
 
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4558,7 +4533,7 @@ run_test 115 "failover for create/unlink striped directory"
 
 test_116a() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.7.55) ] &&
                skip "Do not support large update log before 2.7.55" &&
                return 0
        ([ $FAILURE_MODE == "HARD" ] &&
@@ -4582,7 +4557,7 @@ run_test 116a "large update log master MDT recovery"
 
 test_116b() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.7.55) ] &&
                skip "Do not support large update log before 2.7.55" &&
                return 0
 
@@ -4643,7 +4618,7 @@ run_test 117 "DNE: cross MDT unlink, fail MDT1 and MDT2"
 
 test_118() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.64) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.7.64) ] &&
                skip "Do not support large update log before 2.7.64" &&
                return 0
 
@@ -4672,7 +4647,7 @@ run_test 118 "invalidate osp update will not cause update log corruption"
 
 test_119() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.64) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.7.64) ] &&
                skip "Do not support large update log before 2.7.64" &&
                return 0
        local stripe_count
@@ -4724,7 +4699,7 @@ run_test 119 "timeout of normal replay does not cause DNE replay fails  "
 
 test_120() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.64) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.7.64) ] &&
                skip "Do not support large update log before 2.7.64" &&
                return 0
 
@@ -4757,7 +4732,7 @@ test_120() {
 run_test 120 "DNE fail abort should stop both normal and DNE replay"
 
 test_121() {
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.90) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.10.90) ] &&
                skip "Don't support it before 2.11" &&
                return 0
 
@@ -4794,7 +4769,7 @@ test_121() {
 run_test 121 "lock replay timed out and race"
 
 test_130a() {
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.90) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.10.90) ] &&
                skip "Do not support Data-on-MDT before 2.11"
 
        replay_barrier $SINGLEMDS
@@ -4807,7 +4782,7 @@ test_130a() {
 run_test 130a "DoM file create (setstripe) replay"
 
 test_130b() {
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.90) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.10.90) ] &&
                skip "Do not support Data-on-MDT before 2.11"
 
        mkdir $DIR/$tdir
@@ -4822,7 +4797,7 @@ test_130b() {
 run_test 130b "DoM file create (inherited) replay"
 
 test_131a() {
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.90) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.10.90) ] &&
                skip "Do not support Data-on-MDT before 2.11"
 
        $LFS setstripe -E 1M -L mdt -E EOF -c 2 $DIR/$tfile
@@ -4837,7 +4812,7 @@ test_131a() {
 run_test 131a "DoM file write lock replay"
 
 test_131b() {
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.90) ] &&
+       [ "$MDS1_VERSION" -lt $(version_code 2.10.90) ] &&
                skip "Do not support Data-on-MDT before 2.11"
 
        $LFS setstripe -E 1M -L mdt -E EOF -c 2 $DIR/$tfile
@@ -4853,8 +4828,8 @@ test_131b() {
 run_test 131b "DoM file write replay"
 
 test_132a() {
-       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.9.90) ] &&
-               skip "Do not support PFL files before 2.10"
+       [ "$MDS1_VERSION" -lt $(version_code 2.12.0) ] &&
+               skip "Need MDS version 2.12.0 or later"
 
        $LFS setstripe -E 1M -c 1 -E EOF -c 2 $DIR/$tfile
        replay_barrier $SINGLEMDS
@@ -4879,6 +4854,62 @@ test_132a() {
 }
 run_test 132a "PFL new component instantiate replay"
 
+test_133() {
+       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
+       ([ $FAILURE_MODE == "HARD" ] &&
+               [ "$(facet_host mds1)" == "$(facet_host mds2)" ]) &&
+               skip "MDTs needs to be on diff hosts for HARD fail mode" &&
+               return 0
+
+       local remote_dir=$DIR/$tdir/remote_dir
+
+       mkdir -p $DIR/$tdir || error "mkdir $DIR/$tdir failed"
+       $LFS mkdir -i 1 $remote_dir
+
+       umount $MOUNT
+       do_facet mds2 $LCTL set_param seq.srv*MDT0001.space=clear
+
+       zconf_mount $(hostname) $MOUNT
+       client_up || return 1
+
+       #define OBD_FAIL_MDS_ALL_REQUEST_NET     0x123
+       # SEQ_QUERY                       = 700
+       do_facet mds1 $LCTL set_param fail_val=700 fail_loc=0x80000123
+       cp /etc/hosts $remote_dir/file &
+       local pid=$!
+       sleep 1
+
+       fail_nodf mds1
+
+       wait $pid || error "cp failed"
+       rm -rf $DIR/$tdir || error "rmdir failed"
+
+       return 0
+}
+run_test 133 "check resend of ongoing requests for lwp during failover"
+
+test_134() {
+       [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return 0
+
+       pool_add pool_134
+       pool_add_targets pool_134 1 1
+
+       mkdir -p $DIR/$tdir/{A,B}
+       $LFS setstripe -p pool_134 $DIR/$tdir/A
+       $LFS setstripe -E EOF -p pool_134 $DIR/$tdir/B
+
+       replay_barrier mds1
+
+       touch $DIR/$tdir/A/$tfile || error "touch non-pfl file failed"
+       touch $DIR/$tdir/B/$tfile || error "touch pfl failed"
+
+       fail mds1
+
+       [ -f $DIR/$tdir/A/$tfile ] || error "non-pfl file does not exist"
+       [ -f $DIR/$tdir/B/$tfile ] || error "pfl file does not exist"
+}
+run_test 134 "replay creation of a file created in a pool"
+
 complete $SECONDS
 check_and_cleanup_lustre
 exit_status