From 62cea9be990cf6ff20c16078df1def5c0f52ceb2 Mon Sep 17 00:00:00 2001 From: green Date: Tue, 10 Feb 2004 22:13:31 +0000 Subject: [PATCH] Merge with HEAD --- lustre/tests/replay-single.sh | 74 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 034ee8a..b516587 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -14,7 +14,7 @@ init_test_env $@ . ${CONFIG:=$LUSTRE/tests/cfg/local.sh} # Skip these tests -ALWAYS_EXCEPT="35" +ALWAYS_EXCEPT="" gen_config() { @@ -40,7 +40,7 @@ cleanup() { if [ $activemds != "mds" ]; then fail mds fi - zconf_umount $MOUNT + zconf_umount `hostname` $MOUNT stop mds ${FORCE} $MDSLCONFARGS stop ost2 ${FORCE} --dump cleanup.log stop ost ${FORCE} --dump cleanup.log @@ -62,7 +62,7 @@ setup() { start ost2 --reformat $OSTLCONFARGS [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE start mds $MDSLCONFARGS --reformat - zconf_mount $MOUNT + zconf_mount `hostname` $MOUNT } $SETUP @@ -662,9 +662,12 @@ run_test 34 "abort recovery before client does replay (test mds_cleanup_orphans) test_35() { touch $DIR/$tfile - echo 0x80000119 > /proc/sys/lustre/fail_loc +#define OBD_FAIL_MDS_REINT_NET_REP 0x119 + do_facet mds "sysctl -w lustre.fail_loc=0x80000119" rm -f $DIR/$tfile & sleep 1 + sync + sleep 1 # give a chance to remove from MDS fail_abort mds $CHECKSTAT -t file $DIR/$tfile && return 1 || true @@ -707,5 +710,68 @@ test_37() { } run_test 37 "abort recovery before client does replay (test mds_cleanup_orphans for directories)" +test_38() { + createmany -o $DIR/$tfile-%d 800 + unlinkmany $DIR/$tfile-%d 0 400 + replay_barrier mds + fail mds + unlinkmany $DIR/$tfile-%d 400 400 + sleep 2 + $CHECKSTAT -t file $DIR/$tfile-* && return 1 || true +} +run_test 38 "test recovery from unlink llog (test llog_gen_rec) " + +test_39() { + createmany -o $DIR/$tfile-%d 800 + replay_barrier mds + unlinkmany $DIR/$tfile-%d 0 400 + fail mds + unlinkmany $DIR/$tfile-%d 400 400 + sleep 2 + $CHECKSTAT -t file $DIR/$tfile-* && return 1 || true +} +run_test 39 "test recovery from unlink llog (test llog_gen_rec) " + +count_ost_writes() { + cat /proc/fs/lustre/osc/*/stats | + awk -vwrites=0 '/ost_write/ { writes += $2 } END { print writes; }' +} + +#b=2477,2532 +test_40(){ + $LCTL mark multiop $MOUNT/$tfile OS_c + multiop $MOUNT/$tfile OS_c & + PID=$! + writeme -s $MOUNT/${tfile}-2 & + WRITE_PID=$! + sleep 1 + facet_failover mds +#define OBD_FAIL_MDS_CONNECT_NET 0x117 + do_facet mds "sysctl -w lustre.fail_loc=0x80000117" + kill -USR1 $PID + stat1=`count_ost_writes` + sleep $TIMEOUT + stat2=`count_ost_writes` + echo "$stat1, $stat2" + if [ $stat1 -lt $stat2 ]; then + echo "writes continuing during recovery" + RC=0 + else + echo "writes not continuing during recovery, bug 2477" + RC=4 + fi + echo "waiting for writeme $WRITE_PID" + kill $WRITE_PID + wait $WRITE_PID + + echo "waiting for multiop $PID" + wait $PID || return 2 + do_facet client munlink $MOUNT/$tfile || return 3 + do_facet client munlink $MOUNT/${tfile}-2 || return 3 + return $RC +} +run_test 40 "cause recovery in ptlrpc, ensure IO continues" + equals_msg test complete, cleaning up $CLEANUP + -- 1.8.3.1