From 6e6a3ac4ef3231463e05935ee68a1508b3a5d8d4 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Sat, 2 Jul 2016 08:09:53 +0530 Subject: [PATCH] LU-8586 test: Fix failure due to mixed OST size. Test(pios_ssf) was failing intermittently, because during the setup, OST's were created with different size. This leads to smaller OST filling up much faster during the pios run. Once an OST's is full any subsequent write to FS returns ENOSPC. This patch modifies function space_check() to determine available space information by calculating smallest size "OST x OSTCOUNT". Earlier it was returning "summary" information as reported by "lfs df". Test-Parameters: trivial testlist=sanity-benchmark Signed-off-by: Arshad Hussain Change-Id: Icec25e9857e5ba45f6bec1265c5697ecd92a7751 Seagate-bug-id: MRP-3243 Reviewed-by: Rahul Deshmukh Reviewed-by: Ashish Purkar Reviewed-by: Vladimir Saveliev Tested-by: Elena V. Gryaznova Reviewed-on: https://review.whamcloud.com/22343 Tested-by: Maloo Tested-by: Jenkins Reviewed-by: James Nunez Reviewed-by: Elena Gryaznova Reviewed-by: Oleg Drokin --- lustre/tests/sanity-benchmark.sh | 63 +++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/lustre/tests/sanity-benchmark.sh b/lustre/tests/sanity-benchmark.sh index a56dc84..398656e 100644 --- a/lustre/tests/sanity-benchmark.sh +++ b/lustre/tests/sanity-benchmark.sh @@ -234,33 +234,42 @@ pios_file_size () { } space_check () { - local testdir=$DIR/$tdir - local stripe=$($LFS getstripe -c $testdir) - - # if stripe_count = 1 the size should be less than min ost size, bug 24294 - local space=$(lfs_df $testdir | grep "summary" | awk '{print $4}') - [ $stripe -eq 1 ] && space=$(min_ost_size) - - local size=$(pios_file_size) - size=$(( size + size / 10 )) - # we can not use pios --cleanup|-x because we need the files exist for pios --verify, - # so, we need space available for each of pios_THREADCOUNT value run - local num_runs=$(echo ${pios_THREADCOUNT//,/ } | wc -w) - size=$(( size * $num_runs)) - space=$((space * 1024)) - echo size=$size space=$space - if [ $space -le $size ]; then - local ratio=$(( size / space + 1 )) - echo "Need free space atleast $size, available $space, ratio=$ratio" - local rgcount=$(( pios_REGIONCOUNT / ratio )) - echo "reducing pios_REGIONCOUNT=$pios_REGIONCOUNT on $ratio" - if [ $rgcount -eq 0 ]; then - echo "fs is too small, reduced pios_REGIONCOUNT=$rgcount" - return 10 - fi - pios_REGIONCOUNT=$(( pios_REGIONCOUNT / ratio )) - echo using pios_REGIONCOUNT=$pios_REGIONCOUNT size=$(pios_file_size) - fi + local testdir=$DIR/$tdir + local stripe=$($LFS getstripe -c $testdir) + local min_space_available=0 + + # if stripe_count = 1 the size should be less than min ost size, + # bug 24294 + min_space_available=$(lfs df | grep "^$FSNAME-OST" | \ + awk '{print $4}' | sort -un | head -1) + local space=$((min_space_available * OSTCOUNT)) + + [ $stripe -eq 1 ] && space=$(min_ost_size) + + local size=$(pios_file_size) + size=$(( size + size / 10 )) + # we can not use pios --cleanup|-x because we need the files exist for + # pios --verify, so, we need space available for each of + # pios_THREADCOUNT value run + local num_runs=$(echo ${pios_THREADCOUNT//,/ } | wc -w) + size=$(( size * $num_runs)) + space=$((space * 1024)) + echo size=$size space=$space + if [ $space -le $size ]; then + local ratio=$(( size / space + 1 )) + echo "Need free space atleast $size, \ + available $space, ratio=$ratio" + local rgcount=$(( pios_REGIONCOUNT / ratio )) + echo "reducing pios_REGIONCOUNT=$pios_REGIONCOUNT on $ratio" + if [ $rgcount -eq 0 ]; then + echo "fs is too small, \ + reduced pios_REGIONCOUNT=$rgcount" + return 10 + fi + pios_REGIONCOUNT=$(( pios_REGIONCOUNT / ratio )) + echo using pios_REGIONCOUNT=$pios_REGIONCOUNT \ + size=$(pios_file_size) + fi } pios_setup() { -- 1.8.3.1