X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frecovery-small.sh;h=7b7a97824d172f9a318586999fa6d639bdba75e3;hb=4570931c81d68a6db23aeef769b565686f62707f;hp=3b38c134b6ef91da16ad3a75a0e0c006ca061eaf;hpb=33c4541c63b59a982be5c4d6b06e07d357bdfd34;p=fs%2Flustre-release.git diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 3b38c13..7b7a978 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -23,6 +23,7 @@ SETUP=${SETUP:-""} CLEANUP=${CLEANUP:-""} cleanup_and_setup_lustre +assert_DIR rm -rf $DIR/[df][0-9]* SAMPLE_NAME=recovery-small.junk @@ -123,7 +124,7 @@ run_test 11 "wake up a thread waiting for completion after eviction (b=2460)" #b=2494 test_12(){ $LCTL mark multiop $MOUNT/$tfile OS_c - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x115" clear_failloc $SINGLEMDS $((TIMEOUT * 2)) & multiop_bg_pause $MOUNT/$tfile OS_c || return 1 PID=$! @@ -140,9 +141,9 @@ test_13() { mkdir $MOUNT/readdir || return 1 touch $MOUNT/readdir/newentry || return # OBD_FAIL_MDS_READPAGE_NET|OBD_FAIL_ONCE - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000104" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000104" ls $MOUNT/readdir || return 3 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" rm -rf $MOUNT/readdir || return 4 } run_test 13 "mdc_readpage restart test (bug 1138)" @@ -152,14 +153,14 @@ test_14() { mkdir $MOUNT/readdir touch $MOUNT/readdir/newentry # OBD_FAIL_MDS_SENDPAGE|OBD_FAIL_ONCE - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000106" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000106" ls $MOUNT/readdir || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" } run_test 14 "mdc_readpage resend test (bug 1138)" test_15() { - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000128" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000128" touch $DIR/$tfile && return 1 return 0 } @@ -180,11 +181,11 @@ test_16() { stop_read_ahead #define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE - do_facet ost1 "sysctl -w lustre.fail_loc=0x80000504" + do_facet ost1 "lctl set_param fail_loc=0x80000504" cancel_lru_locks osc # OST bulk will time out here, client resends do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 1 - do_facet ost1 sysctl -w lustre.fail_loc=0 + do_facet ost1 lctl set_param fail_loc=0 # give recovery a chance to finish (shouldn't take long) sleep $TIMEOUT do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 2 @@ -195,13 +196,13 @@ run_test 16 "timeout bulk put, don't evict client (2732)" test_17() { # OBD_FAIL_PTLRPC_BULK_GET_NET 0x0503 | OBD_FAIL_ONCE # OST bulk will time out here, client retries - do_facet ost1 sysctl -w lustre.fail_loc=0x80000503 + do_facet ost1 lctl set_param fail_loc=0x80000503 # need to ensure we send an RPC do_facet client cp /etc/termcap $DIR/$tfile sync sleep $TIMEOUT - do_facet ost1 sysctl -w lustre.fail_loc=0 + do_facet ost1 lctl set_param fail_loc=0 do_facet client "df $DIR" # expect cmp to succeed, client resent bulk do_facet client "cmp /etc/termcap $DIR/$tfile" || return 3 @@ -280,7 +281,7 @@ test_18c() { # OBD_FAIL_OST_CONNECT_NET2 # lost reply to connect request - do_facet ost1 sysctl -w lustre.fail_loc=0x80000225 + do_facet ost1 lctl set_param fail_loc=0x80000225 # force reconnect df $MOUNT > /dev/null 2>&1 sleep 2 @@ -321,11 +322,12 @@ run_test 19b "test expired_lock_main on ost (2867)" test_20a() { # bug 2983 - ldlm_handle_enqueue cleanup mkdir -p $DIR/$tdir + lfs setstripe $DIR/$tdir/${tfile} -i 0 -c 1 multiop_bg_pause $DIR/$tdir/${tfile} O_wc || return 1 MULTI_PID=$! cancel_lru_locks osc #define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308 - do_facet ost1 sysctl -w lustre.fail_loc=0x80000308 + do_facet ost1 lctl set_param fail_loc=0x80000308 kill -USR1 $MULTI_PID wait $MULTI_PID rc=$? @@ -335,10 +337,10 @@ run_test 20a "ldlm_handle_enqueue error (should return error)" test_20b() { # bug 2986 - ldlm_handle_enqueue error during open mkdir -p $DIR/$tdir - touch $DIR/$tdir/${tfile} + lfs setstripe $DIR/$tdir/${tfile} -i 0 -c 1 cancel_lru_locks osc #define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308 - do_facet ost1 sysctl -w lustre.fail_loc=0x80000308 + do_facet ost1 lctl set_param fail_loc=0x80000308 dd if=/etc/hosts of=$DIR/$tdir/$tfile && \ error "didn't fail open enqueue" || true } @@ -350,18 +352,18 @@ test_21a() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000129" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000129" multiop $DIR/$tdir-2/f Oc & open_pid=$! sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks mdc wait $close_pid || return 1 wait $open_pid || return 2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 3 $CHECKSTAT -t file $DIR/$tdir-2/f || return 4 @@ -376,11 +378,11 @@ test_21b() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" mcreate $DIR/$tdir-2/f & open_pid=$! sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" kill -USR1 $close_pid cancel_lru_locks mdc @@ -399,19 +401,19 @@ test_21c() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 close_pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" mcreate $DIR/$tdir-2/f & open_pid=$! sleep 3 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $close_pid cancel_lru_locks mdc wait $close_pid || return 1 wait $open_pid || return 2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -425,16 +427,16 @@ test_21d() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000129" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000129" multiop $DIR/$tdir-2/f Oc & sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -449,10 +451,10 @@ test_21e() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" kill -USR1 $pid cancel_lru_locks mdc @@ -471,16 +473,16 @@ test_21f() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -494,16 +496,16 @@ test_21g() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119" touch $DIR/$tdir-2/f & sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" kill -USR1 $pid cancel_lru_locks mdc wait $pid || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" $CHECKSTAT -t file $DIR/$tdir-1/f || return 2 $CHECKSTAT -t file $DIR/$tdir-2/f || return 3 @@ -517,17 +519,17 @@ test_21h() { multiop_bg_pause $DIR/$tdir-1/f O_c || return 1 pid=$! - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000107" touch $DIR/$tdir-2/f & touch_pid=$! sleep 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000122" cancel_lru_locks mdc kill -USR1 $pid wait $pid || return 1 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" wait $touch_pid || return 2 @@ -542,7 +544,7 @@ test_22() { f1=$DIR/${tfile}-1 f2=$DIR/${tfile}-2 - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000115" multiop $f2 Oc & close_pid=$! @@ -550,7 +552,7 @@ test_22() { multiop $f1 msu || return 1 cancel_lru_locks mdc - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" wait $close_pid || return 2 rm -rf $f2 || return 4 @@ -581,7 +583,7 @@ test_24() { # bug 2248 - eviction fails writeback but app doesn't see it kill -USR1 $MULTI_PID wait $MULTI_PID rc=$? - sysctl -w lustre.fail_loc=0x0 + lctl set_param fail_loc=0x0 client_reconnect [ $rc -eq 0 ] && error_ignore 5494 "multiop didn't fail fsync: rc $rc" || true } @@ -596,7 +598,7 @@ test_26a() { # was test_26 bug 5921 - evict dead exports by pinger OST_NEXP1=`echo $OST_EXP | cut -d' ' -f2` echo starting with $OST_NEXP1 OST exports # OBD_FAIL_PTLRPC_DROP_RPC 0x505 - do_facet client sysctl -w lustre.fail_loc=0x505 + do_facet client lctl set_param fail_loc=0x505 # evictor takes up to 2.25x to evict. But if there's a # race to start the evictor from various obds, the loser # might have to wait for the next ping. @@ -605,7 +607,7 @@ test_26a() { # was test_26 bug 5921 - evict dead exports by pinger OST_EXP="`do_facet ost1 lctl get_param -n $OST_FILE`" OST_NEXP2=`echo $OST_EXP | cut -d' ' -f2` echo ending with $OST_NEXP2 OST exports - do_facet client sysctl -w lustre.fail_loc=0x0 + do_facet client lctl set_param fail_loc=0x0 [ $OST_NEXP1 -le $OST_NEXP2 ] && error "client not evicted" return 0 } @@ -644,10 +646,10 @@ test_27() { FAILURE_MODE="SOFT" facet_failover $SINGLEMDS #define OBD_FAIL_OSC_SHUTDOWN 0x407 - sysctl -w lustre.fail_loc=0x80000407 + lctl set_param fail_loc=0x80000407 # need to wait for reconnect echo -n waiting for fail_loc - while [ `sysctl -n lustre.fail_loc` -eq -2147482617 ]; do + while [ `lctl get_param -n fail_loc` -eq -2147482617 ]; do sleep 1 echo -n . done @@ -663,7 +665,7 @@ test_28() { # bug 6086 - error adding new clients do_facet client mcreate $MOUNT/$tfile || return 1 drop_bl_callback "chmod 0777 $MOUNT/$tfile" ||echo "evicted as expected" #define OBD_FAIL_MDS_CLIENT_ADD 0x12f - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012f" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000012f" # fail once (evicted), reconnect fail (fail_loc), ok df || (sleep 10; df) || (sleep 10; df) || error "reconnect failed" rm -f $MOUNT/$tfile @@ -725,6 +727,7 @@ test_51() { run_test 51 "failover MDS during recovery" test_52_guts() { + do_facet client "mkdir -p $DIR/$tdir" do_facet client "writemany -q -a $DIR/$tdir/$tfile 300 5" & CLIENT_PID=$! echo writemany pid $CLIENT_PID @@ -802,7 +805,7 @@ test_55() { echo "(dd_pid=$DDPID, time=$count)successful" #define OBD_FAIL_OST_DROP_REQ 0x21d - do_facet ost sysctl -w lustre.fail_loc=0x0000021d + do_facet ost lctl set_param fail_loc=0x0000021d # second dd will be never finished dd if=/dev/zero of=$DIR/$tdir/$tfile-2 bs=32M count=4 & DDPID=$! @@ -821,7 +824,7 @@ test_55() { echo "(dd_pid=$DDPID, time=$count)successful" #Recover fail_loc and dd will finish soon - do_facet ost sysctl -w lustre.fail_loc=0 + do_facet ost lctl set_param fail_loc=0 count=0 echo "step3: testing ......" while [ true ]; do @@ -841,9 +844,9 @@ run_test 55 "ost_brw_read/write drops timed-out read/write request" test_56() { # b=11277 #define OBD_FAIL_MDS_RESEND 0x136 touch $DIR/$tfile - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000136" + do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000136" stat $DIR/$tfile - do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0" + do_facet $SINGLEMDS "lctl set_param fail_loc=0" rm -f $DIR/$tfile } run_test 56 "do not allow reconnect to busy exports" @@ -860,12 +863,12 @@ test_57() { # bug 10866 pid=$! sleep 1 #define OBD_FAIL_LPROC_REMOVE 0xB00 - sysctl -w lustre.fail_loc=0x80000B00 + lctl set_param fail_loc=0x80000B00 zconf_umount `hostname` $DIR - sysctl -w lustre.fail_loc=0x80000B00 + lctl set_param fail_loc=0x80000B00 fail_abort $SINGLEMDS kill -9 $pid - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 mount_client $DIR do_facet client "df $DIR" } @@ -875,11 +878,11 @@ test_58() { # bug 11546 #define OBD_FAIL_MDC_ENQUEUE_PAUSE 0x801 touch $MOUNT/$tfile ls -la $MOUNT/$tfile - sysctl -w lustre.fail_loc=0x80000801 + lctl set_param fail_loc=0x80000801 cp $MOUNT/$tfile /dev/null & pid=$! sleep 1 - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 drop_bl_callback rm -f $MOUNT/$tfile wait $pid do_facet client "df $DIR" @@ -890,11 +893,11 @@ test_59() { # bug 10589 zconf_mount `hostname` $MOUNT2 || error "Failed to mount $MOUNT2" echo $DIR2 | grep -q $MOUNT2 || error "DIR2 is not set properly: $DIR2" #define OBD_FAIL_LDLM_CANCEL_EVICT_RACE 0x311 - sysctl -w lustre.fail_loc=0x311 + lctl set_param fail_loc=0x311 writes=$(LANG=C dd if=/dev/zero of=$DIR2/$tfile count=1 2>&1) [ $? = 0 ] || error "dd write failed" writes=$(echo $writes | awk -F '+' '/out/ {print $1}') - sysctl -w lustre.fail_loc=0 + lctl set_param fail_loc=0 sync zconf_umount `hostname` $MOUNT2 -f reads=$(LANG=C dd if=$DIR/$tfile of=/dev/null 2>&1)