Whamcloud - gitweb
LU-6455 tests: Re-enable replay-vbr and replay-single tests
[fs/lustre-release.git] / lustre / tests / replay-vbr.sh
old mode 100644 (file)
new mode 100755 (executable)
index f633a0d..7da4f8a
@@ -20,6 +20,7 @@ init_logging
 
 remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
 
+#                                  ~6  (min)"
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="7"
 
 build_test_filter
@@ -711,12 +712,6 @@ test_7_cycle() {
     do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
     do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
 
-       local at_max_saved=0
-       if at_is_enabled; then
-               at_max_saved=$(at_max_get $SINGLEMDS)
-               at_max_set $TIMEOUT mds client
-       fi
-
     do_node $CLIENT1 mkdir -p $DIR/$tdir
     replay_barrier $SINGLEMDS
     # first operation
@@ -736,7 +731,6 @@ test_7_cycle() {
        wait_recovery_complete $SINGLEMDS
        wait_mds_ost_sync || error "wait_mds_ost_sync failed"
 
-       [[ $at_max_saved -eq 0 ]] || at_max_set $at_max_saved mds client
        rm -rf $DIR/$tdir
        return $rc
 }
@@ -1184,6 +1178,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