From 9e3866b21c51c44e323a83ee11087bf91894d5da Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 30 Jan 2004 18:36:42 +0000 Subject: [PATCH] Make the debugging more clear as to which OST/client it is for (hard to see otherwise with multiple OSTs on one node). Take pending writes into account in totals. Don't spew errors when hit. --- lustre/tests/oos2.sh | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/lustre/tests/oos2.sh b/lustre/tests/oos2.sh index e6334dd..f8604e3 100644 --- a/lustre/tests/oos2.sh +++ b/lustre/tests/oos2.sh @@ -12,11 +12,12 @@ MOUNT2=${MOUNT2:-${MOUNT}2} OOS=$MOUNT/oosfile OOS2=$MOUNT2/oosfile2 LOG=$TMP/oosfile +LOG2=${LOG}2 TMP=${TMP:-/tmp} SUCCESS=1 -rm -f $OOS $OOS2 $LOG +rm -f $OOS $OOS2 $LOG $LOG2 STRIPECOUNT=`cat /proc/fs/lustre/lov/*/activeobd | head -1` ORIGFREE=`cat /proc/fs/lustre/llite/*/kbytesavail | head -1` @@ -31,11 +32,11 @@ fi export LANG=C LC_LANG=C # for "No space left on device" message # make sure we stripe over all OSTs to avoid OOS on only a subset of OSTs -$LFS setstripe $OOS 65536 0 $STRIPECOUNT -$LFS setstripe $OOS2 65536 0 $STRIPECOUNT +$LFS setstripe $OOS 65536 -1 $STRIPECOUNT +$LFS setstripe $OOS2 65536 -1 $STRIPECOUNT dd if=/dev/zero of=$OOS count=$((3 * $ORIGFREE / 4 + 100)) bs=1k 2>> $LOG & DDPID=$! -if dd if=/dev/zero of=$OOS2 count=$((3*$ORIGFREE/4 + 100)) bs=1k 2>> $LOG; then +if dd if=/dev/zero of=$OOS2 count=$((3*$ORIGFREE/4 + 100)) bs=1k 2>> $LOG2; then echo "ERROR: dd2 did not fail" SUCCESS=0 fi @@ -44,27 +45,25 @@ if wait $DDPID; then SUCCESS=0 fi -if [ "`grep -c 'No space left on device' $LOG`" -ne 2 ]; then +if [ "`cat $LOG $LOG2 | grep -c 'No space left on device'`" -ne 2 ]; then echo "ERROR: dd not return ENOSPC" SUCCESS=0 fi +# flush cache to OST(s) so avail numbers are correct +sync; sleep 1 ; sync + for AVAIL in /proc/fs/lustre/osc/OSC*MNT*/kbytesavail; do [ `cat $AVAIL` -lt 400 ] && OSCFULL=full done if [ -z "$OSCFULL" ]; then echo "no OSTs are close to full" - grep "[0-9]" /proc/fs/lustre/osc/OSC*MNT*/{kbytesavail,cur*} + grep "[0-9]" /proc/fs/lustre/osc/OSC*MNT*/{kbytesavail,cur*} |tee -a $LOG + SUCCESS=0 fi -total_records() { - tot=0 - for i in `grep "records out" $1 | cut -d+ -f 1`; do - tot=$(($tot + $i)) - done - echo $tot -} -RECORDSOUT=`total_records $LOG` +RECORDSOUT=$((`grep "records out" $LOG | cut -d+ -f 1` + \ + `grep "records out" $LOG2 | cut -d+ -f 1`)) FILESIZE=$((`ls -l $OOS | awk '{print $5}'` + `ls -l $OOS2 | awk '{print $5}'`)) if [ $RECORDSOUT -ne $(($FILESIZE / 1024)) ]; then @@ -72,7 +71,7 @@ if [ $RECORDSOUT -ne $(($FILESIZE / 1024)) ]; then SUCCESS=0 fi -rm -f $OOS $OOS2 $LOG +rm -f $OOS $OOS2 if [ $SUCCESS -eq 1 ]; then echo "Success!" -- 1.8.3.1