Commit addd9c3c authored by John Esmet's avatar John Esmet

FT-580 Remove unused scripts

parent 674454b0
#!/usr/bin/env bash
function usage() {
echo "run db-benchmark-test"
echo "[--tokudb=$tokudb"
echo "[--revision=$revision]"
echo "[--branch=$branch]"
echo "[--suffix=$suffix]"
echo "[--commit=$commit]"
echo "[--cc=$cc]"
echo "[--n=$n]"
}
function retry() {
local cmd
local retries
local exitcode
cmd=$*
let retries=0
while [ $retries -le 10 ] ; do
echo `date` $cmd
bash -c "$cmd"
exitcode=$?
echo `date` $cmd $exitcode $retries
let retries=retries+1
if [ $exitcode -eq 0 ] ; then break; fi
sleep 10
done
test $exitcode = 0
}
n=100
cc=gcc44
ft_loader=cilk
branch=toku
revision=0
tokudb=tokudb
suffix=.
commit=0
svnserver=https://svn.tokutek.com/tokudb
basedir=$HOME/svn.build
builddir=$basedir/tokudb.build
system=`uname -s | tr [:upper:] [:lower:]`
arch=`uname -m | tr [:upper:] [:lower:]`
hostname=`hostname`
instancetype=""
# parse the command line
while [ $# -gt 0 ] ; do
arg=$1; shift
if [[ $arg =~ --(.*)=(.*) ]] ; then
eval ${BASH_REMATCH[1]}=${BASH_REMATCH[2]}
else
usage; exit 1
fi
done
if [ $cc = icc ] ; then
d=/opt/intel/bin
if [ -d $d ] ; then
export PATH=$d:$PATH
. $d/compilervars.sh intel64
fi
d=/opt/intel/cilkutil/bin
if [ -d $d ] ; then
export PATH=$d:$PATH
fi
fi
# require a revision
if [ $revision -eq 0 ] ; then exit 1; fi
if [ $branch = "." ] ; then branch="toku"; fi
function append() {
local s=""; local x
for x in $*; do
if [ "$s" != "" ] ; then s=$s-$x; else s=$x; fi
done
echo $s
}
# setup the branchrevision string
branchrevision=""
if [ $branch != "toku" ] ; then branchrevision=$(append $branchrevision $(basename $branch)); fi
if [ $tokudb != "tokudb" ] ; then branchrevision=$(append $branchrevision $tokudb); fi
branchrevision=$(append $branchrevision $revision)
if [ $suffix != "." ] ; then branchrevision=$(append $branchrevision $suffix); fi
# goto the base directory
if [ ! -d $basedir ] ; then mkdir $basedir; fi
pushd $basedir
# update the build directory
if [ ! -d $builddir ] ; then mkdir $builddir; fi
date=`date +%Y%m%d`
pushd $builddir
while [ ! -d $date ] ; do
svn mkdir $svnserver/mysql.build/$date -m ""
svn co -q $svnserver/mysql.build/$date
if [ $? -ne 0 ] ; then rm -rf $date; fi
done
popd
testresultsdir=$builddir/$date
gccversion=`$cc --version|head -1|cut -f3 -d" "`
runfile=$testresultsdir/db-benchmark-test-$branchrevision-$cc-$gccversion-$system-$arch-$hostname
if [ "$instancetype" != "" ] ; then runfile=$runfile-$instancetype; fi
rm -rf $runfile
testresult="PASS"
testdir=db-benchmark-test-$branchrevision
rm -rf $testdir
# checkout the tokudb branch
if [ $testresult = "PASS" ] ; then
retry svn export -q https://svn.tokutek.com/tokudb/$branch/$tokudb $testdir
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
fi
# build it
if [ $testresult = "PASS" ] ; then
pushd $testdir
make release -s CC=$cc GCCVERSION=$gccversion FTLOADER=$ft_loader >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
popd
pushd $testdir/db-benchmark-test
make build.tdb CC=$cc GCCVERSION=$gccversion -s >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
popd
fi
# run tests
if [ $testresult = "PASS" ] ; then
let i=$n
pushd $testdir/db-benchmark-test
echo ./db-benchmark-test-tokudb -x $i >>$runfile 2>&1
./db-benchmark-test-tokudb -x $i >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
echo ./scanscan-tokudb --prelock --prelockflag >>$runfile 2>&1
./scanscan-tokudb --prelock --prelockflag >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
echo ./scanscan-tokudb --lwc --prelock --prelockflag >>$runfile 2>&1
./scanscan-tokudb --lwc --prelock --prelockflag >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
popd
fi
if [ $testresult = "PASS" ] ; then
let i=2*$n
pushd $testdir/db-benchmark-test
echo ./db-benchmark-test-tokudb -x --norandom $i >>$runfile 2>&1
./db-benchmark-test-tokudb -x --norandom $i >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
echo ./scanscan-tokudb --prelock --prelockflag >>$runfile 2>&1
./scanscan-tokudb --prelock --prelockflag >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
echo ./scanscan-tokudb --lwc --prelock --prelockflag >>$runfile 2>&1
./scanscan-tokudb --lwc --prelock --prelockflag >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
popd
fi
if [ $testresult = "PASS" ] ; then
let i=2*$n
pushd $testdir/db-benchmark-test
echo ./db-benchmark-test-tokudb -x --noserial $i >>$runfile 2>&1
./db-benchmark-test-tokudb -x --noserial $i >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
echo ./scanscan-tokudb --prelock --prelockflag >>$runfile 2>&1
./scanscan-tokudb --prelock --prelockflag >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
echo ./scanscan-tokudb --lwc --prelock --prelockflag >>$runfile 2>&1
./scanscan-tokudb --lwc --prelock --prelockflag >>$runfile 2>&1
exitcode=$?
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
popd
fi
# commit results
if [ $commit != 0 ] ; then
svn add $runfile
retry svn commit -m \"$testresult db-benchmark-test $branchrevision $system $arch\" $runfile
fi
popd
exit 0
This diff is collapsed.
#!/usr/bin/env bash
run.fractal.tree.tests.bash --ftcc=icc $*
#!/bin/bash
pushd $(dirname $0) &>/dev/null
SCRIPTDIR=$PWD
popd &>/dev/null
exec $SCRIPTDIR/run.fractal.tree.tests.bash --ctest_model=Experimental --commit=0 "$@"
#!/usr/bin/env bash
function usage() {
echo "run the loader verify test"
echo "[--rows=$rows]"
echo "[--dictionaries=$dictionaries]"
echo "[--ft_loader=$ft_loader]"
echo "[--tokudb=$tokudb]"
echo "[--branch=$branch]"
echo "[--revision=$revision]"
echo "[--suffix=$suffix]"
echo "[--commit=$commit]"
}
function retry() {
local cmd
local retries
local exitcode
cmd=$*
let retries=0
while [ $retries -le 10 ] ; do
echo `date` $cmd
bash -c "$cmd"
exitcode=$?
echo `date` $cmd $exitcode $retries
let retries=retries+1
if [ $exitcode -eq 0 ] ; then break; fi
sleep 10
done
test $exitcode = 0
}
rows=100000000
dictionaries=3
ft_loader=cilk
tokudb=tokudb
branch=.
revision=0
suffix=.
commit=0
svnserver=https://svn.tokutek.com/tokudb
basedir=~/svn.build
builddir=$basedir/mysql.build
system=`uname -s | tr [:upper:] [:lower:]`
arch=`uname -m | tr [:upper:] [:lower:]`
myhost=`hostname`
instancetype=""
ftcc=gcc
have_cilk=0
# parse the command line
while [ $# -gt 0 ] ; do
arg=$1; shift
if [[ $arg =~ --(.*)=(.*) ]] ; then
eval ${BASH_REMATCH[1]}=${BASH_REMATCH[2]}
else
usage; exit 1
fi
done
# require a revision
if [ $revision -eq 0 ] ; then
exit 1
fi
# build
if [ $ftcc = icc ] ; then
d=/opt/intel/bin
if [ -d $d ] ; then
export PATH=$d:$PATH
. $d/compilervars.sh intel64
fi
d=/opt/intel/cilkutil/bin
if [ -d $d ] ; then
export PATH=$d:$PATH
fi
fi
# setup the branchrevision string
if [ $branch = "." ] ; then
branchrevision=$revision
else
branchrevision=`basename $branch`-$revision
fi
if [ $suffix != "." ] ; then
branchrevision=$branchrevision-$suffix
fi
ftccversion=$($ftcc --version|head -1|cut -f3 -d" ")
# goto the base directory
if [ ! -d $basedir ] ; then mkdir $basedir; fi
pushd $basedir
# update the build directory
if [ ! -d $builddir ] ; then mkdir $builddir; fi
date=`date +%Y%m%d`
testresultsdir=$builddir/$date
pushd $builddir
while [ ! -d $date ] ; do
svn mkdir $svnserver/mysql.build/$date -m ""
svn checkout $svnserver/mysql.build/$date
if [ $? -ne 0 ] ; then rm -rf $date; fi
done
popd
testresult="PASS"
runfile=$testresultsdir/loader-stress-$rows-$dictionaries-$tokudb-$branchrevision-$ftcc-$ftccversion-$system-$arch-$myhost
if [ "$instancetype" != "" ] ; then runfilefile=$runfile-$instancetype; fi
rm -f $runfile
# checkout the code
if [ -d loader-stress-$branchrevision ] ; then rm -rf loader-stress-$branchrevision; fi
mkdir loader-stress-$branchrevision
if [ $branch = "." ] ; then branch=toku; fi
retry svn export -r $revision -q $svnserver/$branch/$tokudb loader-stress-$branchrevision/$tokudb
exitcode=$?
if [ $exitcode != 0 ] ; then
testresult="FAIL"
fi
if [ $testresult = "PASS" ] ; then
pushd loader-stress-$branchrevision/$tokudb
echo `date` make release -s CC=$ftcc HAVE_CILK=$have_cilk FTLOADER=$ft_loader >>$runfile
make -s release CC=$ftcc HAVE_CILK=$have_cilk FTLOADER=$ft_loader >>$runfile 2>&1
exitcode=$?
echo `date` complete $exitcode >>$runfile
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
popd
fi
if [ $testresult = "PASS" ] ; then
pushd loader-stress-$branchrevision/$tokudb/src/tests
echo `date` make loader-stress-test.tdb CC=$ftcc HAVE_CILK=$have_cilk >>$runfile
make loader-stress-test.tdb -s CC=$ftcc HAVE_CILK=$have_cilk >>$runfile 2>&1
exitcode=$?
echo `date` complete $exitcode >>$runfile
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
popd
fi
# run
if [ $testresult = "PASS" ] ; then
pushd loader-stress-$branchrevision/$tokudb/src/tests
echo `date` ./loader-stress-test.tdb -v -r $rows -d $dictionaries -c >>$runfile
./loader-stress-test.tdb -v -r $rows -d $dictionaries -c >>$runfile 2>&1
exitcode=$?
echo `date` complete $exitcode >>$runfile
if [ $exitcode != 0 ] ; then testresult="FAIL"; fi
popd
fi
if [ $commit != 0 ] ; then
svn add $runfile
retry svn commit -m \"$testresult loader stress $rows $dictionaries $tokudb $branchrevision $ftcc $ftccversion $system $arch $myhost\" $runfile
fi
popd
if [ $testresult = "PASS" ] ; then exitcode=0; else exitcode=1; fi
exit $exitcode
#!/bin/bash
# $Id$
DOC=<<EOF
PARAMETERS
table size: small (2 000), medium (200 000), large (50 000 000)
cachetable size: small (num_elements * 50), large (1 000 000 000)
update threads: 1, random number <= 20
point query threads: 1, random number <= 20
recover-test_stress1, recover-test_stress2
DATA
currently running tests
log of success/failure ("./recover-test_stress1.tdb --num_elements blah blah blah PASS")
if failed:
parameters
corefile
stdout/stderr
data directory
EOF
set -e
. /opt/intel/bin/compilervars.sh intel64
scriptname=$(basename "$0")
toku_toplevel=$(dirname $(dirname $(readlink -f "$PWD/$0")))
log=/tmp/run.stress-tests.log
savedir=/tmp/run.stress-tests.failures
usage() {
echo "Usage: $scriptname" 1>&2
echo " [--toku_toplevel=<dir>]" 1>&2
echo " [--log=<file>]" 1>&2
echo " [--savedir=<dir>]" 1>&2
}
# parse the command line
while [ $# -gt 0 ] ; do
arg=$1; shift
if [[ $arg =~ --(.*)=(.*) ]] ; then
ok=no
for opt in toku_toplevel log savedir
do
if [[ ${BASH_REMATCH[1]} = $opt ]]
then
ok=yes
fi
done
if [[ $ok = no ]]
then
usage; exit 1
fi
eval ${BASH_REMATCH[1]}=${BASH_REMATCH[2]}
else
usage; exit 1
fi
done
src_tests="${toku_toplevel}/src/tests"
testnames=(test_stress1.tdb \
test_stress5.tdb \
test_stress6.tdb)
recover_testnames=(recover-test_stress1.tdb \
recover-test_stress2.tdb \
recover-test_stress3.tdb)
save_failure() {
dir="$1"; shift
out="$1"; shift
envdir="$1"; shift
rev=$1; shift
exec="$1"; shift
table_size=$1; shift
cachetable_size=$1; shift
num_ptquery=$1; shift
num_update=$1; shift
phase=$1; shift
dest="${dir}/${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-${phase}-${rev}-$$"
mkdir -p "$dest"
mv $out "${dest}/output.txt"
mv core* "${dest}/"
mv $envdir "${dest}/"
}
running=no
run_test() {
rev=$1; shift
exec="$1"; shift
table_size="$1"; shift
cachetable_size="$1"; shift
num_ptquery="$1"; shift
num_update="$1"; shift
mylog="$1"; shift
mysavedir="$1"; shift
rundir=$(mktemp -d ./rundir.XXXXXXXX)
tmplog=$(mktemp)
ulimit -c unlimited
t0="$(date)"
t1=""
t2=""
envdir="../${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-$$.dir"
cd $rundir
if LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
../$exec -v --only_create --num_seconds 600 --envdir "$envdir" \
--num_elements $table_size \
--cachetable_size $cachetable_size &> $tmplog
then
rm -f $tmplog
t1="$(date)"
if LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
../$exec -v --only_stress --num_seconds 600 --no-crash_on_update_failure --envdir "$envdir" \
--num_elements $table_size \
--cachetable_size $cachetable_size \
--num_ptquery_threads $num_ptquery \
--num_update_threads $num_update &> $tmplog
then
rm -f $tmplog
t2="$(date)"
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,PASS" | tee -a "$mylog"
else
save_failure "$mysavedir" $tmplog $envdir $rev $exec $table_size $cachetable_size $num_ptquery $num_update stress
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,FAIL" | tee -a "$mylog"
fi
else
save_failure "$mysavedir" $tmplog $envdir $rev $exec $table_size $cachetable_size $num_ptquery $num_update create
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,FAIL" | tee -a "$mylog"
fi
cd ..
rm -rf $rundir "$envdir"
}
loop_test() {
rev=$1; shift
exec="$1"; shift
table_size="$1"; shift
cachetable_size="$1"; shift
mylog="$1"; shift
mysavedir="$1"; shift
ptquery_rand=0
update_rand=0
while [[ $running = "yes" ]]
do
num_ptquery=1
num_update=1
if [[ $ptquery_rand -gt 1 ]]
then
(( num_ptquery = $RANDOM % 16 ))
fi
if [[ $update_rand -gt 0 ]]
then
(( num_update = $RANDOM % 16 ))
fi
(( ptquery_rand = (ptquery_rand + 1) % 4 ))
(( update_rand = (update_rand + 1) % 2 ))
run_test $rev $exec $table_size $cachetable_size $num_ptquery $num_update $mylog $mysavedir
done
}
run_recover_test() {
rev=$1; shift
exec="$1"; shift
table_size="$1"; shift
cachetable_size="$1"; shift
num_ptquery="$1"; shift
num_update="$1"; shift
mylog="$1"; shift
mysavedir="$1"; shift
rundir=$(mktemp -d ./rundir.XXXXXXXX)
tmplog=$(mktemp)
ulimit -c unlimited
t0="$(date)"
t1=""
t2=""
envdir="../${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-$$.dir"
cd $rundir
if ! LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
../$exec -v --test --num_seconds 600 --no-crash_on_update_failure --envdir "$envdir" \
--num_elements $table_size \
--cachetable_size $cachetable_size \
--num_ptquery_threads $num_ptquery \
--num_update_threads $num_update &> $tmplog
then
rm -f $tmplog
t1="$(date)"
if LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
../$exec -v --recover --envdir "$envdir" \
--num_elements $table_size \
--cachetable_size $cachetable_size &> $tmplog
then
rm -f $tmplog
t2="$(date)"
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,PASS" | tee -a "$mylog"
else
save_failure "$mysavedir" $tmplog $envdir $rev $exec $table_size $cachetable_size $num_ptquery $num_update recover
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,FAIL" | tee -a "$mylog"
fi
else
save_failure "$mysavedir" $tmplog $envdir $rev $exec $table_size $cachetable_size $num_ptquery $num_update test
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,FAIL" | tee -a "$mylog"
fi
cd ..
rm -rf $rundir "$envdir"
}
loop_recover_test() {
rev=$1; shift
exec="$1"; shift
table_size="$1"; shift
cachetable_size="$1"; shift
mylog="$1"; shift
mysavedir="$1"; shift
ptquery_rand=0
update_rand=0
while [[ $running = "yes" ]]
do
num_ptquery=1
num_update=1
if [[ $ptquery_rand -gt 1 ]]
then
(( num_ptquery = $RANDOM % 16 ))
fi
if [[ $update_rand -gt 0 ]]
then
(( num_update = $RANDOM % 16 ))
fi
(( ptquery_rand = (ptquery_rand + 1) % 4 ))
(( update_rand = (update_rand + 1) % 2 ))
run_recover_test $rev $exec $table_size $cachetable_size $num_ptquery $num_update $mylog $mysavedir
done
}
declare -a pids=(0)
i=0
savepid() {
pids[$i]=$1
(( i = i + 1 ))
}
killchildren() {
kill ${pids[@]} || true
for exec in ${testnames[@]} ${recover_testnames[@]}
do
pkill -f $exec || true
done
}
trap killchildren INT TERM EXIT
mkdir -p $log
mkdir -p $savedir
while true
do
(cd $toku_toplevel; \
svn update; \
make CC=icc DEBUG=0 HAVE_CILK=0 clean fastbuild; \
make CC=icc DEBUG=0 HAVE_CILK=0 -C src/tests ${testnames[@]} ${recover_testnames[@]})
cd $src_tests
rev=$(svn info ../.. | awk '/Revision/ { print $2 }')
running=yes
for exec in ${testnames[@]}
do
for table_size in 2000 200000 50000000
do
(( small_cachetable = table_size * 50 ))
suffix="${exec}-${table_size}-${small_cachetable}-$$"
touch "${log}/${suffix}"
loop_test $rev $exec $table_size $small_cachetable "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
suffix="${exec}-${table_size}-1000000000-$$"
touch "${log}/${suffix}"
loop_test $rev $exec $table_size 1000000000 "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
done
done
for exec in ${recover_testnames[@]}
do
for table_size in 2000 200000 50000000
do
(( small_cachetable = table_size * 50 ))
suffix="${exec}-${table_size}-${small_cachetable}-$$"
touch "${log}/${suffix}"
loop_recover_test $rev $exec $table_size $small_cachetable "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
suffix="${exec}-${table_size}-1000000000-$$"
touch "${log}/${suffix}"
loop_recover_test $rev $exec $table_size 1000000000 "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
done
done
sleep 1d
running=no
killchildren
wait ${pids[@]} || true
idx=0
for pid in ${pids[@]}
do
pids[$idx]=0
(( idx = idx + 1 ))
done
done
#!/usr/bin/env bash
set -e
test $# -ge 4
tdbbin=$1; shift
bdbbin=$1; shift
tdbenv=$1; shift
bdbenv=$1; shift
tdbdump=$1; shift
bdbdump=$1; shift
TOKU_TEST_FILENAME=$bdbenv $bdbbin
$bdbdump -p -h $bdbenv main > dump.bdb.1426
TOKU_TEST_FILENAME=$tdbenv $tdbbin
$tdbdump -x -p -h $tdbenv main > dump.tdb.1426
diff -I db_pagesize=4096 dump.bdb.1426 dump.tdb.1426
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment