8
table size: small (2 000), medium (200 000), large (50 000 000)
10
cachetable size: small (num_elements * 50), large (1 000 000 000)
12
update threads: 1, random number <= 20
14
point query threads: 1, random number <= 20
16
recover-test_stress1, recover-test_stress2
20
currently running tests
22
log of success/failure ("./recover-test_stress1.tdb --num_elements blah blah blah PASS")
38
. /opt/intel/bin/compilervars.sh intel64
40
scriptname=$(basename "$0")
41
toku_toplevel=$(dirname $(dirname $(readlink -f "$PWD/$0")))
42
log=/tmp/run.stress-tests.log
43
savedir=/tmp/run.stress-tests.failures
46
echo "Usage: $scriptname" 1>&2
47
echo " [--toku_toplevel=<dir>]" 1>&2
48
echo " [--log=<file>]" 1>&2
49
echo " [--savedir=<dir>]" 1>&2
52
# parse the command line
53
while [ $# -gt 0 ] ; do
55
if [[ $arg =~ --(.*)=(.*) ]] ; then
57
for opt in toku_toplevel log savedir
59
if [[ ${BASH_REMATCH[1]} = $opt ]]
68
eval ${BASH_REMATCH[1]}=${BASH_REMATCH[2]}
74
src_tests="${toku_toplevel}/src/tests"
75
testnames=(test_stress1.tdb \
78
recover_testnames=(recover-test_stress1.tdb \
79
recover-test_stress2.tdb \
80
recover-test_stress3.tdb)
89
cachetable_size=$1; shift
93
dest="${dir}/${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-${phase}-${rev}-$$"
95
mv $out "${dest}/output.txt"
105
table_size="$1"; shift
106
cachetable_size="$1"; shift
107
num_ptquery="$1"; shift
108
num_update="$1"; shift
110
mysavedir="$1"; shift
112
rundir=$(mktemp -d ./rundir.XXXXXXXX)
119
envdir="../${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-$$.dir"
121
if LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
122
../$exec -v --only_create --num_seconds 600 --envdir "$envdir" \
123
--num_elements $table_size \
124
--cachetable_size $cachetable_size &> $tmplog
128
if LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
129
../$exec -v --only_stress --num_seconds 600 --no-crash_on_update_failure --envdir "$envdir" \
130
--num_elements $table_size \
131
--cachetable_size $cachetable_size \
132
--num_ptquery_threads $num_ptquery \
133
--num_update_threads $num_update &> $tmplog
137
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,PASS" | tee -a "$mylog"
139
save_failure "$mysavedir" $tmplog $envdir $rev $exec $table_size $cachetable_size $num_ptquery $num_update stress
140
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,FAIL" | tee -a "$mylog"
143
save_failure "$mysavedir" $tmplog $envdir $rev $exec $table_size $cachetable_size $num_ptquery $num_update create
144
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,FAIL" | tee -a "$mylog"
147
rm -rf $rundir "$envdir"
153
table_size="$1"; shift
154
cachetable_size="$1"; shift
156
mysavedir="$1"; shift
160
while [[ $running = "yes" ]]
164
if [[ $ptquery_rand -gt 1 ]]
166
(( num_ptquery = $RANDOM % 16 ))
168
if [[ $update_rand -gt 0 ]]
170
(( num_update = $RANDOM % 16 ))
172
(( ptquery_rand = (ptquery_rand + 1) % 4 ))
173
(( update_rand = (update_rand + 1) % 2 ))
174
run_test $rev $exec $table_size $cachetable_size $num_ptquery $num_update $mylog $mysavedir
181
table_size="$1"; shift
182
cachetable_size="$1"; shift
183
num_ptquery="$1"; shift
184
num_update="$1"; shift
186
mysavedir="$1"; shift
188
rundir=$(mktemp -d ./rundir.XXXXXXXX)
195
envdir="../${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-$$.dir"
197
if ! LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
198
../$exec -v --test --num_seconds 600 --no-crash_on_update_failure --envdir "$envdir" \
199
--num_elements $table_size \
200
--cachetable_size $cachetable_size \
201
--num_ptquery_threads $num_ptquery \
202
--num_update_threads $num_update &> $tmplog
206
if LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
207
../$exec -v --recover --envdir "$envdir" \
208
--num_elements $table_size \
209
--cachetable_size $cachetable_size &> $tmplog
213
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,PASS" | tee -a "$mylog"
215
save_failure "$mysavedir" $tmplog $envdir $rev $exec $table_size $cachetable_size $num_ptquery $num_update recover
216
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,FAIL" | tee -a "$mylog"
219
save_failure "$mysavedir" $tmplog $envdir $rev $exec $table_size $cachetable_size $num_ptquery $num_update test
220
echo "\"$exec\",$rev,$table_size,$cachetable_size,$num_ptquery,$num_update,$t0,$t1,$t2,FAIL" | tee -a "$mylog"
223
rm -rf $rundir "$envdir"
226
loop_recover_test() {
229
table_size="$1"; shift
230
cachetable_size="$1"; shift
232
mysavedir="$1"; shift
236
while [[ $running = "yes" ]]
240
if [[ $ptquery_rand -gt 1 ]]
242
(( num_ptquery = $RANDOM % 16 ))
244
if [[ $update_rand -gt 0 ]]
246
(( num_update = $RANDOM % 16 ))
248
(( ptquery_rand = (ptquery_rand + 1) % 4 ))
249
(( update_rand = (update_rand + 1) % 2 ))
250
run_recover_test $rev $exec $table_size $cachetable_size $num_ptquery $num_update $mylog $mysavedir
263
kill ${pids[@]} || true
264
for exec in ${testnames[@]} ${recover_testnames[@]}
266
pkill -f $exec || true
270
trap killchildren INT TERM EXIT
277
(cd $toku_toplevel; \
279
make CC=icc DEBUG=0 HAVE_CILK=0 clean fastbuild; \
280
make CC=icc DEBUG=0 HAVE_CILK=0 -C src/tests ${testnames[@]} ${recover_testnames[@]})
284
rev=$(svn info ../.. | awk '/Revision/ { print $2 }')
288
for exec in ${testnames[@]}
290
for table_size in 2000 200000 50000000
292
(( small_cachetable = table_size * 50 ))
293
suffix="${exec}-${table_size}-${small_cachetable}-$$"
294
touch "${log}/${suffix}"
295
loop_test $rev $exec $table_size $small_cachetable "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
297
suffix="${exec}-${table_size}-1000000000-$$"
298
touch "${log}/${suffix}"
299
loop_test $rev $exec $table_size 1000000000 "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
303
for exec in ${recover_testnames[@]}
305
for table_size in 2000 200000 50000000
307
(( small_cachetable = table_size * 50 ))
308
suffix="${exec}-${table_size}-${small_cachetable}-$$"
309
touch "${log}/${suffix}"
310
loop_recover_test $rev $exec $table_size $small_cachetable "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
312
suffix="${exec}-${table_size}-1000000000-$$"
313
touch "${log}/${suffix}"
314
loop_recover_test $rev $exec $table_size 1000000000 "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
324
wait ${pids[@]} || true
327
for pid in ${pids[@]}