Whamcloud - gitweb
LU-4819 tests: Lustre Sanity test_101b hangs for large OSTCOUNTs 88/9788/2
authorParinay Kondekar <parinay_kondekar@xyratex.com>
Wed, 26 Mar 2014 05:44:20 +0000 (11:14 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 21 Apr 2014 03:41:49 +0000 (03:41 +0000)
sanity.sh test_101b hangs during Lustre sanity test. This
is happening especially in cases where the $OSTCOUNT is
greater than 100.

Due to OSTCOUNT of more than 100, the ITERATION parameter
results in '0', which causes the 'reads' utility to run
in infinite 'for' loop. Thus resulting in a hang on such
setups.

This change would make necessary changes in FILE_LENGTH in
test_101b and its related routines(setup_101bc, ra_check)
so that, the test won't hang and would proceed rightly.

Signed-off-by: Parinay Kondekar <parinay_kondekar@xyratex.com>
Change-Id: I0815dfd8777d3055cf5dd6de01b2a18d1bff96bf
Xyratex-bug-id: MRP-1362
Reviewed-on: http://review.whamcloud.com/9788
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index 533437a..de5dc50 100644 (file)
@@ -5916,10 +5916,12 @@ run_test 101a "check read-ahead for random reads ================"
 
 setup_test101bc() {
        test_mkdir -p $DIR/$tdir
-       STRIPE_SIZE=1048576
-       STRIPE_COUNT=$OSTCOUNT
+       local STRIPE_SIZE=$1
+       local FILE_LENGTH=$2
        STRIPE_OFFSET=0
 
+       local FILE_SIZE_MB=$((FILE_LENGTH / STRIPE_SIZE))
+
        local list=$(comma_list $(osts_nodes))
        set_osd_param $list '' read_cache_enable 0
        set_osd_param $list '' writethrough_cache_enable 0
@@ -5928,7 +5930,9 @@ setup_test101bc() {
        # prepare the read-ahead file
        $SETSTRIPE -S $STRIPE_SIZE -i $STRIPE_OFFSET -c $OSTCOUNT $DIR/$tfile
 
-       dd if=/dev/zero of=$DIR/$tfile bs=1024k count=100 2> /dev/null
+       dd if=/dev/zero of=$DIR/$tfile bs=$STRIPE_SIZE \
+                               count=$FILE_SIZE_MB 2> /dev/null
+
 }
 
 cleanup_test101bc() {
@@ -5947,10 +5951,10 @@ calc_total() {
 
 ra_check_101() {
        local READ_SIZE=$1
-       local STRIPE_SIZE=1048576
+       local STRIPE_SIZE=$2
+       local FILE_LENGTH=$3
        local RA_INC=1048576
        local STRIDE_LENGTH=$((STRIPE_SIZE/READ_SIZE))
-       local FILE_LENGTH=$((64*100))
        local discard_limit=$((((STRIDE_LENGTH - 1)*3/(STRIDE_LENGTH*OSTCOUNT))* \
                             (STRIDE_LENGTH*OSTCOUNT - STRIDE_LENGTH)))
        DISCARD=`$LCTL get_param -n llite.*.read_ahead_stats | \
@@ -5969,10 +5973,16 @@ test_101b() {
        [ "$OSTCOUNT" -lt "2" ] && skip_env "skipping stride IO stride-ahead test" && return
        local STRIPE_SIZE=1048576
        local STRIDE_SIZE=$((STRIPE_SIZE*OSTCOUNT))
-       local FILE_LENGTH=$((STRIPE_SIZE*100))
-       local ITERATION=$((FILE_LENGTH/STRIDE_SIZE))
+       if [ $SLOW == "yes" ]; then
+               local FILE_LENGTH=$((STRIDE_SIZE * 64))
+       else
+               local FILE_LENGTH=$((STRIDE_SIZE * 8))
+       fi
+
+       local ITERATION=$((FILE_LENGTH / STRIDE_SIZE))
+
        # prepare the read-ahead file
-       setup_test101bc
+       setup_test101bc $STRIPE_SIZE $FILE_LENGTH
        cancel_lru_locks osc
        for BIDX in 2 4 8 16 32 64 128 256
        do
@@ -5984,7 +5994,7 @@ test_101b() {
                $READS -f $DIR/$tfile  -l $STRIDE_LENGTH -o $OFFSET \
                              -s $FILE_LENGTH -b $STRIPE_SIZE -a $READ_COUNT -n $ITERATION
                cancel_lru_locks osc
-               ra_check_101 $BSIZE
+               ra_check_101 $BSIZE $STRIPE_SIZE $FILE_LENGTH
        done
        cleanup_test101bc
        true
@@ -5998,7 +6008,7 @@ test_101c() {
        local nreads=10000
        local osc_rpc_stats
 
-       setup_test101bc
+       setup_test101bc $STRIPE_SIZE $FILE_LENGTH
 
        cancel_lru_locks osc
        $LCTL set_param osc.*.rpc_stats 0