Skip to content
Snippets Groups Projects
Commit 2b0c9ae8 authored by Elena Gryaznova's avatar Elena Gryaznova
Browse files

b=12499

i=Adilger
i=Shadow

insanity and recovery-small cleanup (patless unrealted)
parent 5397b022
No related branches found
No related tags found
No related merge requests found
...@@ -187,9 +187,11 @@ test_0() { ...@@ -187,9 +187,11 @@ test_0() {
echo "Waiting for df pid: $DFPID" echo "Waiting for df pid: $DFPID"
wait $DFPID || { echo "df returned $?" && return 2; } wait $DFPID || { echo "df returned $?" && return 2; }
facet_failover ost2 || return 5 if [ $OSTCOUNT -gt 1 ]; then
echo "Waiting for df pid: $DFPID" facet_failover ost2 || return 5
wait $DFPID || { echo "df returned $?" && return 3; } echo "Waiting for df pid: $DFPID"
wait $DFPID || { echo "df returned $?" && return 3; }
fi
return 0 return 0
} }
run_test 0 "Fail all nodes, independently" run_test 0 "Fail all nodes, independently"
...@@ -315,6 +317,8 @@ run_test 4 "Fourth Failure Mode: OST/MDS `date`" ...@@ -315,6 +317,8 @@ run_test 4 "Fourth Failure Mode: OST/MDS `date`"
############### Fifth Failure Mode ############### ############### Fifth Failure Mode ###############
test_5() { test_5() {
[ $OSTCOUNT -lt 1 ] && echo "skipping test_5, not enough OSTs" && return 0
echo "Fifth Failure Mode: OST/OST `date`" echo "Fifth Failure Mode: OST/OST `date`"
#Create files #Create files
......
...@@ -60,21 +60,25 @@ test_3() { ...@@ -60,21 +60,25 @@ test_3() {
} }
run_test 3 "stat: drop req, drop rep" run_test 3 "stat: drop req, drop rep"
SAMPLE_NAME=recovery-small.junk
SAMPLE_FILE=$TMP/$SAMPLE_NAME
dd if=/dev/urandom of=$SAMPLE_FILE bs=1K count=4
test_4() { test_4() {
do_facet client "cp /etc/inittab $MOUNT/inittab" || return 1 do_facet client "cp $SAMPLE_FILE $MOUNT/$SAMPLE_NAME" || return 1
drop_request "cat $MOUNT/inittab > /dev/null" || return 2 drop_request "cat $MOUNT/$SAMPLE_NAME > /dev/null" || return 2
drop_reply "cat $MOUNT/inittab > /dev/null" || return 3 drop_reply "cat $MOUNT/$SAMPLE_NAME > /dev/null" || return 3
} }
run_test 4 "open: drop req, drop rep" run_test 4 "open: drop req, drop rep"
test_5() { test_5() {
drop_request "mv $MOUNT/inittab $MOUNT/renamed" || return 1 drop_request "mv $MOUNT/$SAMPLE_NAME $MOUNT/renamed" || return 1
drop_reint_reply "mv $MOUNT/renamed $MOUNT/renamed-again" || return 2 drop_reint_reply "mv $MOUNT/renamed $MOUNT/renamed-again" || return 2
do_facet client "checkstat -v $MOUNT/renamed-again" || return 3 do_facet client "checkstat -v $MOUNT/renamed-again" || return 3
} }
run_test 5 "rename: drop req, drop rep" run_test 5 "rename: drop req, drop rep"
[ ! -e $MOUNT/renamed-again ] && cp /etc/inittab $MOUNT/renamed-again [ ! -e $MOUNT/renamed-again ] && cp $SAMPLE_FILE $MOUNT/renamed-again
test_6() { test_6() {
drop_request "mlink $MOUNT/renamed-again $MOUNT/link1" || return 1 drop_request "mlink $MOUNT/renamed-again $MOUNT/link1" || return 1
drop_reint_reply "mlink $MOUNT/renamed-again $MOUNT/link2" || return 2 drop_reint_reply "mlink $MOUNT/renamed-again $MOUNT/link2" || return 2
...@@ -95,10 +99,13 @@ test_8() { ...@@ -95,10 +99,13 @@ test_8() {
} }
run_test 8 "touch: drop rep (bug 1423)" run_test 8 "touch: drop rep (bug 1423)"
SAMPLE_FILE=$TMP/recovery-small.junk
dd if=/dev/urandom of=$SAMPLE_FILE bs=1M count=4
#bug 1420 #bug 1420
test_9() { test_9() {
pause_bulk "cp /etc/profile $MOUNT/$tfile" || return 1 pause_bulk "cp /etc/profile $MOUNT/$tfile" || return 1
do_facet client "cp /etc/termcap $MOUNT/${tfile}.2" || return 2 do_facet client "cp $SAMPLE_FILE $MOUNT/${tfile}.2" || return 2
do_facet client "sync" do_facet client "sync"
do_facet client "rm $MOUNT/$tfile $MOUNT/${tfile}.2" || return 3 do_facet client "rm $MOUNT/$tfile $MOUNT/${tfile}.2" || return 3
} }
...@@ -192,7 +199,7 @@ start_read_ahead() { ...@@ -192,7 +199,7 @@ start_read_ahead() {
} }
test_16() { test_16() {
do_facet client cp /etc/termcap $MOUNT do_facet client cp $SAMPLE_FILE $MOUNT
sync sync
stop_read_ahead stop_read_ahead
...@@ -200,11 +207,11 @@ test_16() { ...@@ -200,11 +207,11 @@ test_16() {
do_facet ost1 sysctl -w lustre.fail_loc=0x80000504 do_facet ost1 sysctl -w lustre.fail_loc=0x80000504
cancel_lru_locks osc cancel_lru_locks osc
# OST bulk will time out here, client resends # OST bulk will time out here, client resends
do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 1 do_facet client "cmp $SAMPLE_FILE $MOUNT/${SAMPLE_FILE##*/}" || return 1
do_facet ost1 sysctl -w lustre.fail_loc=0 do_facet ost1 sysctl -w lustre.fail_loc=0
# give recovery a chance to finish (shouldn't take long) # give recovery a chance to finish (shouldn't take long)
sleep $TIMEOUT sleep $TIMEOUT
do_facet client "cmp /etc/termcap $MOUNT/termcap" || return 2 do_facet client "cmp $SAMPLE_FILE $MOUNT/${SAMPLE_FILE##*/}" || return 2
start_read_ahead start_read_ahead
} }
run_test 16 "timeout bulk put, don't evict client (2732)" run_test 16 "timeout bulk put, don't evict client (2732)"
...@@ -214,14 +221,14 @@ test_17() { ...@@ -214,14 +221,14 @@ test_17() {
# OST bulk will time out here, client retries # OST bulk will time out here, client retries
do_facet ost1 sysctl -w lustre.fail_loc=0x80000503 do_facet ost1 sysctl -w lustre.fail_loc=0x80000503
# need to ensure we send an RPC # need to ensure we send an RPC
do_facet client cp /etc/termcap $DIR/$tfile do_facet client cp $SAMPLE_FILE $DIR/$tfile
sync sync
sleep $TIMEOUT sleep $TIMEOUT
do_facet ost1 sysctl -w lustre.fail_loc=0 do_facet ost1 sysctl -w lustre.fail_loc=0
do_facet client "df $DIR" do_facet client "df $DIR"
# expect cmp to succeed, client resent bulk # expect cmp to succeed, client resent bulk
do_facet client "cmp /etc/termcap $DIR/$tfile" || return 3 do_facet client "cmp $SAMPLE_FILE $DIR/$tfile" || return 3
do_facet client "rm $DIR/$tfile" || return 4 do_facet client "rm $DIR/$tfile" || return 4
return 0 return 0
} }
...@@ -239,7 +246,7 @@ test_18a() { ...@@ -239,7 +246,7 @@ test_18a() {
# 1 stripe on ost2 # 1 stripe on ost2
lfs setstripe $f $((128 * 1024)) 1 1 lfs setstripe $f $((128 * 1024)) 1 1
do_facet client cp /etc/termcap $f do_facet client cp $SAMPLE_FILE $f
sync sync
local osc2dev=`grep ${ost2_svc}-osc- $LPROC/devices | awk '{print $1}'` local osc2dev=`grep ${ost2_svc}-osc- $LPROC/devices | awk '{print $1}'`
$LCTL --device $osc2dev deactivate || return 3 $LCTL --device $osc2dev deactivate || return 3
...@@ -265,7 +272,7 @@ test_18b() { ...@@ -265,7 +272,7 @@ test_18b() {
lfs setstripe $f $((128 * 1024)) 0 1 lfs setstripe $f $((128 * 1024)) 0 1
lfs setstripe $f2 $((128 * 1024)) 0 1 lfs setstripe $f2 $((128 * 1024)) 0 1
do_facet client cp /etc/termcap $f do_facet client cp $SAMPLE_FILE $f
sync sync
ost_evict_client ost_evict_client
# allow recovery to complete # allow recovery to complete
...@@ -564,9 +571,9 @@ test_24() { # bug 2248 - eviction fails writeback but app doesn't see it ...@@ -564,9 +571,9 @@ test_24() { # bug 2248 - eviction fails writeback but app doesn't see it
cancel_lru_locks osc cancel_lru_locks osc
multiop $DIR/$tdir/$tfile Owy_wyc & multiop $DIR/$tdir/$tfile Owy_wyc &
MULTI_PID=$! MULTI_PID=$!
usleep 500 sleep 0.500s
ost_evict_client ost_evict_client
usleep 500 sleep 0.500s
kill -USR1 $MULTI_PID kill -USR1 $MULTI_PID
wait $MULTI_PID wait $MULTI_PID
rc=$? rc=$?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment