Whamcloud - gitweb
Revert "LU-8922 lod: check master stripes properly"
[fs/lustre-release.git] / lustre / tests / replay-vbr.sh
old mode 100644 (file)
new mode 100755 (executable)
index c0a1d23..3fb72d3
@@ -7,6 +7,12 @@ set -e
 # bug number:  16356
 ALWAYS_EXCEPT="12a   $REPLAY_VBR_EXCEPT"
 
+case "$(lsb_release -sr)" in   # only disable tests for el7
+7*)    # bug number:  LU-6455
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 4i 4j 4k 10b"
+       ;;
+esac
+
 SAVE_PWD=$PWD
 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
 SETUP=${SETUP:-}
@@ -20,6 +26,7 @@ init_logging
 
 remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
 
+#                                  ~6  (min)"
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="7"
 
 build_test_filter
@@ -727,11 +734,11 @@ test_7_cycle() {
     # should fail as conflict expected
     client_evicted $CLIENT1 || rc=1
 
-    wait_recovery_complete $SINGLEMDS
+       wait_recovery_complete $SINGLEMDS
        wait_mds_ost_sync || error "wait_mds_ost_sync failed"
 
-    rm -rf $DIR/$tdir
-    return $rc
+       rm -rf $DIR/$tdir
+       return $rc
 }
 
 test_7a() {
@@ -887,7 +894,14 @@ test_7g() {
     first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile"
     lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
     last="link $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
-    test_7_cycle "$first" "$lost" "$last" || error "Test 7g.3 failed"
+       if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.1) ]
+       then
+               test_7_cycle "$first" "$lost" "$last" ||
+                       error "Test 7g.3 failed"
+       else #LU-4442 LU-3528
+               test_7_cycle "$first" "$lost" "$last" &&
+                       error "Test 7g.3 failed"
+       fi
     return 0
 }
 run_test 7g "rename, {lost}, create"
@@ -1170,6 +1184,48 @@ test_12a() { # former test_2a
 }
 run_test 12a "lost data due to missed REMOTE client during replay"
 
+test_13() { # LU-8826
+       local var=${SINGLEMDS}_svc
+
+       if combined_mgs_mds ; then
+               skip "Needs separate MGS to enable IR"
+               return 0
+       fi
+
+       do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
+       do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
+
+       zconf_mount $CLIENT2 $MOUNT2
+       do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $DIR/$tfile
+
+       # set ir_timeout to a reasonable small value
+       local ir_timeout=$(do_facet mgs $LCTL get_param -n mgs.*.ir_timeout)
+       do_facet mgs $LCTL set_param mgs.*.ir_timeout=5
+       # make sure IR functional
+       sleep 5
+
+       replay_barrier $SINGLEMDS
+       do_node $CLIENT1 chmod 666 $DIR/$tfile
+       do_node $CLIENT2 chmod 777 $DIR2/$tfile
+
+       # make sure client data of $CLIENT2:$MOUNT2 is remained
+       # define OBD_FAIL_TGT_CLIENT_DEL        0x718
+       do_facet $SINGLEMDS $LCTL set_param fail_loc=0x718
+       zconf_umount $CLIENT2 $MOUNT2
+       # define OBD_FAIL_TGT_SLUGGISH_NET      0x719
+       do_facet $SINGLEMDS $LCTL set_param fail_loc=0x719
+       facet_failover $SINGLEMDS
+
+       client_up $CLIENT1 || error "$CLIENT1 evicted"
+
+       do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+       do_facet mgs $LCTL set_param mgs.*.ir_timeout=$ir_timeout
+
+       do_node $CLIENT1 $CHECKSTAT -p 0666 $DIR/$tfile ||
+               error "$DIR/$tfile-a: unexpected state"
+}
+run_test 13 "Shouldn't give up VBR easily on sluggish network"
+
 #restore COS setting
 restore_lustre_params < $cos_param_file
 rm -f $cos_param_file