X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Freplay-ost-single.sh;h=036750b6322450af7b053ab95468a040dfca47ba;hb=51206e8cd42134400fa0b6259a92d7138f3dc984;hp=7a74166b5c359a6871f17909c1b323123a5623ff;hpb=8c4f96f910786ff3d73474ef5f8d4a96a30a0bed;p=fs%2Flustre-release.git diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 7a74166..036750b 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -176,23 +176,31 @@ test_6() { f=$TDIR/$tfile rm -f $f - sync && sleep 2 && sync # wait for delete thread + sync && sleep 2 && sync # wait for delete thread + + # wait till space is returned, following + # (( $before > $after_dd)) test counting on that + wait_mds_ost_sync || return 4 + wait_destroy_complete || return 5 + before=`kbytesfree` dd if=/dev/urandom bs=4096 count=1280 of=$f || return 28 lfs getstripe $f - get_stripe_info client $f + stripe_index=$(lfs getstripe -i $f) sync sleep 2 # ensure we have a fresh statfs sync -#define OBD_FAIL_MDS_REINT_NET_REP 0x119 + + #define OBD_FAIL_MDS_REINT_NET_REP 0x119 do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000119" after_dd=`kbytesfree` log "before: $before after_dd: $after_dd" (( $before > $after_dd )) || return 1 rm -f $f fail ost$((stripe_index + 1)) - wait_recovery_complete ost$((stripe_index + 1)) || error "OST recovery not done" + wait_recovery_complete ost$((stripe_index + 1)) || + error "OST$((stripe_index + 1)) recovery not completed" $CHECKSTAT -t file $f && return 2 || true sync # let the delete happen @@ -200,7 +208,7 @@ test_6() { wait_destroy_complete || return 5 after=`kbytesfree` log "before: $before after: $after" - (( $before <= $after + 40 )) || return 3 # take OST logs into account + (( $before <= $after + 40 )) || return 3 # take OST logs into account } run_test 6 "Fail OST before obd_destroy" @@ -208,6 +216,12 @@ test_7() { f=$TDIR/$tfile rm -f $f sync && sleep 5 && sync # wait for delete thread + + # wait till space is returned, following + # (( $before > $after_dd)) test counting on that + wait_mds_ost_sync || return 4 + wait_destroy_complete || return 5 + before=`kbytesfree` dd if=/dev/urandom bs=4096 count=1280 of=$f || return 4 sync @@ -231,6 +245,66 @@ test_7() { } run_test 7 "Fail OST before obd_destroy" +test_8a() { + verify=$ROOT/tmp/verify-$$ + dd if=/dev/urandom of=$verify bs=4096 count=1280 || + error "Create verify file failed" +#define OBD_FAIL_OST_DQACQ_NET 0x230 + do_facet ost1 "lctl set_param fail_loc=0x230" + dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & + ddpid=$! + sleep $TIMEOUT # wait for the io to become redo io + if ! ps -p $ddpid > /dev/null 2>&1; then + error "redo io finished incorrectly" + return 1 + fi + do_facet ost1 "lctl set_param fail_loc=0" + wait $ddpid || return 1 + cancel_lru_locks osc + cmp $verify $TDIR/$tfile || return 2 + rm -f $verify $TDIR/$tfile +} +run_test 8a "Verify redo io: redo io when get -EINPROGRESS error" + +test_8b() { + verify=$ROOT/tmp/verify-$$ + dd if=/dev/urandom of=$verify bs=4096 count=1280 || + error "Create verify file failed" +#define OBD_FAIL_OST_DQACQ_NET 0x230 + do_facet ost1 "lctl set_param fail_loc=0x230" + dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & + ddpid=$! + sleep $TIMEOUT # wait for the io to become redo io + fail ost1 + do_facet ost1 "lctl set_param fail_loc=0" + wait $ddpid || return 1 + cancel_lru_locks osc + cmp $verify $TDIR/$tfile || return 2 + rm -f $verify $TDIR/$tfile +} +run_test 8b "Verify redo io: redo io should success after recovery" + +test_8c() { + verify=$ROOT/tmp/verify-$$ + dd if=/dev/urandom of=$verify bs=4096 count=1280 || + error "Create verify file failed" +#define OBD_FAIL_OST_DQACQ_NET 0x230 + do_facet ost1 "lctl set_param fail_loc=0x230" + dd if=$verify of=$TDIR/$tfile bs=4096 count=1280 oflag=sync & + ddpid=$! + sleep $TIMEOUT # wait for the io to become redo io + ost_evict_client + # allow recovery to complete + sleep $((TIMEOUT + 2)) + do_facet ost1 "lctl set_param fail_loc=0" + wait $ddpid + cancel_lru_locks osc + cmp $verify $TDIR/$tfile && return 2 + rm -f $verify $TDIR/$tfile +} +run_test 8c "Verify redo io: redo io should fail after eviction" + + complete $(basename $0) $SECONDS check_and_cleanup_lustre exit_status