From ada98f0dc159675613ebb6162d07289ab48704a8 Mon Sep 17 00:00:00 2001 From: Parinay Kondekar Date: Wed, 26 Mar 2014 11:14:20 +0530 Subject: [PATCH] LU-4819 tests: Lustre Sanity test_101b hangs for large OSTCOUNTs 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 Change-Id: I0815dfd8777d3055cf5dd6de01b2a18d1bff96bf Xyratex-bug-id: MRP-1362 Reviewed-on: http://review.whamcloud.com/9788 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Nathaniel Clark Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 533437a..de5dc50 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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 -- 1.8.3.1