diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 52699a6a37..878235cae4 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -24601,6 +24601,51 @@ test_902() { } run_test 902 "test short write doesn't hang lustre" +function create_and_checktime() { + local i + local start + + for ((i=0; i < $2; i++)); do + start=$SECONDS + multiop $1-$i Oc + (($SECONDS-$start > $TIMEOUT)) && + echo "creation took " $((SECONDS-$start)) + echo "creation took " $((SECONDS-$start)) + done +} + +test_1000() { + local f0=$DIR/${tfile}-0 + local f1=$DIR/${tfile}-1 + + wait_delete_completed + + # refill precreated objects + $LFS setstripe -i0 -c1 $f0 + + # introduce OST imbalance to force QoS-based allocation + $LFS setstripe -i1 -c1 $f1 + dd if=/dev/zero of=$f1 bs=1M count=500 oflag=direct + sleep_maxage + + # one OST is unavailable, but still have few objects preallocated + stop ost1 + + for ((i=0; i < 7; i++)); do + mkdir $DIR/$tdir$i + create_and_checktime $DIR/$tdir$i/$tfile- 100 & + done + wait + + for ((i=0; i < 10; i++)); do + #lfs df -i + num=$(ls $DIR | wc -l) + echo "$num FILES CREATED" + sleep $TIMEOUT + done +} +run_test 1000 + complete $SECONDS [ -f $EXT2_DEV ] && rm $EXT2_DEV || true check_and_cleanup_lustre