2019-09-03 15:09:04 -07:00
|
|
|
|
#!/usr/bin/env bash
|
2019-07-12 21:27:34 +03:00
|
|
|
|
|
2024-05-19 22:07:58 +03:00
|
|
|
|
# Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru>
|
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
2024-11-06 21:17:39 +03:00
|
|
|
|
if [ "${BASH_VERSION}" \< "4.3" ]; then
|
|
|
|
|
echo "Bash-shell 4.3 or later is REQUIRED." >&2
|
|
|
|
|
echo "Present Bash-shell version is '${BASH_VERSION}' (BASH_VERSION)" >&2
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2022-11-10 10:49:01 +03:00
|
|
|
|
LIST=basic
|
2021-07-05 18:27:27 +03:00
|
|
|
|
FROM=1
|
|
|
|
|
UPTO=9999999
|
|
|
|
|
MONITOR=
|
|
|
|
|
LOOPS=
|
|
|
|
|
SKIP_MAKE=no
|
2022-01-20 23:38:27 +03:00
|
|
|
|
GEOMETRY_JITTER=yes
|
2024-11-06 11:34:46 +03:00
|
|
|
|
BANNER="$(which banner 2>/dev/null || echo echo)"
|
2019-08-10 23:04:00 +03:00
|
|
|
|
UNAME="$(uname -s 2>/dev/null || echo Unknown)"
|
2021-07-12 10:53:12 +03:00
|
|
|
|
DB_UPTO_MB=17408
|
2022-07-09 10:31:47 +03:00
|
|
|
|
PAGESIZE=min
|
2022-11-10 00:17:48 +03:00
|
|
|
|
DONT_CHECK_RAM=no
|
2023-02-27 20:45:25 +03:00
|
|
|
|
EXTRA=no
|
2023-10-30 12:25:05 +03:00
|
|
|
|
TAILLOG=0
|
2024-05-22 21:33:58 +03:00
|
|
|
|
DELAY=0
|
2024-11-06 10:28:23 +03:00
|
|
|
|
REPORT_DEPTH=no
|
2024-11-06 22:48:36 +03:00
|
|
|
|
REPEAT=11
|
|
|
|
|
ROUNDS=1
|
|
|
|
|
SMALL=no
|
2021-07-05 18:27:27 +03:00
|
|
|
|
|
|
|
|
|
while [ -n "$1" ]
|
|
|
|
|
do
|
|
|
|
|
case "$1" in
|
|
|
|
|
--help)
|
2021-07-19 12:42:57 +03:00
|
|
|
|
echo "--multi Engage multi-process test scenario (default)"
|
|
|
|
|
echo "--single Execute series of single-process tests (for QEMU, etc)"
|
2022-01-25 23:27:55 +03:00
|
|
|
|
echo "--nested Execute only 'nested' testcase"
|
|
|
|
|
echo "--hill Execute only 'hill' testcase"
|
|
|
|
|
echo "--append Execute only 'append' testcase"
|
|
|
|
|
echo "--ttl Execute only 'ttl' testcase"
|
2021-07-19 12:42:57 +03:00
|
|
|
|
echo "--with-valgrind Run tests under Valgrind's memcheck tool"
|
|
|
|
|
echo "--skip-make Don't (re)build libmdbx and test's executable"
|
|
|
|
|
echo "--from NN Start iterating from the NN ops per test case"
|
|
|
|
|
echo "--upto NN Don't run tests with more than NN ops per test case"
|
2024-11-06 22:48:36 +03:00
|
|
|
|
echo "--repeat NN Repeat each testcase NN times within test run"
|
|
|
|
|
echo "--rounds NN Cycle each n-ops/wbatch case NN times"
|
2021-07-19 12:42:57 +03:00
|
|
|
|
echo "--loops NN Stop after the NN loops"
|
|
|
|
|
echo "--dir PATH Specifies directory for test DB and other files (it will be cleared)"
|
|
|
|
|
echo "--db-upto-mb NN Limits upper size of test DB to the NN megabytes"
|
2024-08-11 00:23:34 +03:00
|
|
|
|
echo "--db-upto-gb NN --''--''--''--''--''--''--''--''-- NN gigabytes"
|
2022-01-20 23:38:27 +03:00
|
|
|
|
echo "--no-geometry-jitter Disable jitter for geometry upper-size"
|
2023-02-27 20:45:25 +03:00
|
|
|
|
echo "--pagesize NN Use specified page size (256 is minimal and used by default)"
|
|
|
|
|
echo "--dont-check-ram-size Don't check available RAM"
|
|
|
|
|
echo "--extra Iterate extra modes/flags"
|
2023-10-30 12:25:05 +03:00
|
|
|
|
echo "--taillog Dump tail of test log on failure"
|
2024-05-22 21:33:58 +03:00
|
|
|
|
echo "--delay NN Delay NN seconds before run test"
|
2024-11-06 10:28:23 +03:00
|
|
|
|
echo "--report-depth Report tree depth (tee+grep log)"
|
2024-11-06 22:48:36 +03:00
|
|
|
|
echo "--small Small transactions/batch/nops pattern"
|
2021-07-19 12:42:57 +03:00
|
|
|
|
echo "--help Print this usage help and exit"
|
|
|
|
|
exit -2
|
2021-07-05 18:27:27 +03:00
|
|
|
|
;;
|
2023-10-30 12:25:05 +03:00
|
|
|
|
--taillog)
|
2023-11-10 12:33:21 +03:00
|
|
|
|
TAILLOG=3333
|
2023-10-30 12:25:05 +03:00
|
|
|
|
;;
|
2021-07-05 18:27:27 +03:00
|
|
|
|
--multi)
|
|
|
|
|
LIST=basic
|
|
|
|
|
;;
|
|
|
|
|
--single)
|
|
|
|
|
LIST="--nested --hill --append --ttl --copy"
|
|
|
|
|
;;
|
2022-01-25 23:27:55 +03:00
|
|
|
|
--nested)
|
|
|
|
|
LIST="--nested"
|
|
|
|
|
;;
|
|
|
|
|
--hill)
|
|
|
|
|
LIST="--hill"
|
|
|
|
|
;;
|
|
|
|
|
--append)
|
|
|
|
|
LIST="--append"
|
|
|
|
|
;;
|
|
|
|
|
--ttl)
|
|
|
|
|
LIST="--ttl"
|
|
|
|
|
;;
|
2021-07-05 18:27:27 +03:00
|
|
|
|
--with-valgrind)
|
|
|
|
|
echo " NOTE: Valgrind could produce some false-positive warnings"
|
|
|
|
|
echo " in multi-process environment with shared memory."
|
|
|
|
|
echo " For instance, when the process 'A' explicitly marks a memory"
|
|
|
|
|
echo " region as 'undefined', the process 'B' fill it,"
|
|
|
|
|
echo " and after this process 'A' read such region, etc."
|
2023-10-11 13:40:41 +03:00
|
|
|
|
MONITOR="valgrind --trace-children=yes --log-file=valgrind-%p.log --leak-check=full --track-origins=yes --read-var-info=yes --error-exitcode=42 --suppressions=test/valgrind_suppress.txt"
|
2021-07-05 18:27:27 +03:00
|
|
|
|
rm -f valgrind-*.log
|
|
|
|
|
;;
|
|
|
|
|
--skip-make)
|
|
|
|
|
SKIP_MAKE=yes
|
|
|
|
|
;;
|
|
|
|
|
--from)
|
2021-07-13 09:47:28 +03:00
|
|
|
|
FROM=$(($2))
|
2021-07-05 18:27:27 +03:00
|
|
|
|
if [ -z "$FROM" -o "$FROM" -lt 1 ]; then
|
|
|
|
|
echo "Invalid value '$FROM' for --from option"
|
|
|
|
|
exit -2
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
|
|
|
|
--upto)
|
2021-07-13 09:47:28 +03:00
|
|
|
|
UPTO=$(($2))
|
2021-07-05 18:27:27 +03:00
|
|
|
|
if [ -z "$UPTO" -o "$UPTO" -lt 1 ]; then
|
|
|
|
|
echo "Invalid value '$UPTO' for --upto option"
|
|
|
|
|
exit -2
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2024-11-06 22:48:36 +03:00
|
|
|
|
--repeat|--reps|--rep)
|
|
|
|
|
REPEAT=$(($2))
|
|
|
|
|
if [ -z "$REPEAT" -o "$REPEAT" -lt 1 -o "$REPEAT" -gt 99 ]; then
|
|
|
|
|
echo "Invalid value '$REPEAT' for --repeat option"
|
|
|
|
|
exit -2
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
|
|
|
|
--rounds)
|
|
|
|
|
ROUNDS=$(($2))
|
|
|
|
|
if [ -z "$ROUNDS" -o "$ROUNDS" -lt 1 -o "$ROUNDS" -gt 99 ]; then
|
|
|
|
|
echo "Invalid value '$ROUNDS' for --rounds option"
|
|
|
|
|
exit -2
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2021-07-05 18:27:27 +03:00
|
|
|
|
--loops)
|
2021-07-13 09:47:28 +03:00
|
|
|
|
LOOPS=$(($2))
|
2021-07-05 18:27:27 +03:00
|
|
|
|
if [ -z "$LOOPS" -o "$LOOPS" -lt 1 -o "$LOOPS" -gt 99 ]; then
|
|
|
|
|
echo "Invalid value '$LOOPS' for --loops option"
|
|
|
|
|
exit -2
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
|
|
|
|
--dir)
|
|
|
|
|
TESTDB_DIR="$2"
|
|
|
|
|
if [ -z "$TESTDB_DIR" ]; then
|
|
|
|
|
echo "Invalid value '$TESTDB_DIR' for --dir option"
|
|
|
|
|
exit -2
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2021-07-12 10:53:12 +03:00
|
|
|
|
--db-upto-mb)
|
2021-07-13 09:47:28 +03:00
|
|
|
|
DB_UPTO_MB=$(($2))
|
2021-07-12 10:53:12 +03:00
|
|
|
|
if [ -z "$DB_UPTO_MB" -o "$DB_UPTO_MB" -lt 1 -o "$DB_UPTO_MB" -gt 4194304 ]; then
|
|
|
|
|
echo "Invalid value '$DB_UPTO_MB' for --db-upto-mb option"
|
|
|
|
|
exit -2
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2024-08-11 00:23:34 +03:00
|
|
|
|
--db-upto-gb)
|
|
|
|
|
DB_UPTO_MB=$(($2 * 1024))
|
|
|
|
|
if [ -z "$DB_UPTO_MB" -o "$DB_UPTO_MB" -lt 1 -o "$DB_UPTO_MB" -gt 4194304 ]; then
|
|
|
|
|
echo "Invalid value '$2' for --db-upto-gb option"
|
|
|
|
|
exit -2
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2022-01-20 23:38:27 +03:00
|
|
|
|
--no-geometry-jitter)
|
|
|
|
|
GEOMETRY_JITTER=no
|
|
|
|
|
;;
|
2022-10-10 21:59:51 +03:00
|
|
|
|
--pagesize|--page-size)
|
2022-07-09 10:31:47 +03:00
|
|
|
|
case "$2" in
|
|
|
|
|
min|max|256|512|1024|2048|4096|8192|16386|32768|65536)
|
|
|
|
|
PAGESIZE=$2
|
|
|
|
|
;;
|
|
|
|
|
1|1k|1K|k|K)
|
|
|
|
|
PAGESIZE=$((1024*1))
|
|
|
|
|
;;
|
|
|
|
|
2|2k|2K)
|
|
|
|
|
PAGESIZE=$((1024*2))
|
|
|
|
|
;;
|
|
|
|
|
4|4k|4K)
|
|
|
|
|
PAGESIZE=$((1024*4))
|
|
|
|
|
;;
|
|
|
|
|
8|8k|8K)
|
|
|
|
|
PAGESIZE=$((1024*8))
|
|
|
|
|
;;
|
|
|
|
|
16|16k|16K)
|
|
|
|
|
PAGESIZE=$((1024*16))
|
|
|
|
|
;;
|
|
|
|
|
32|32k|32K)
|
|
|
|
|
PAGESIZE=$((1024*32))
|
|
|
|
|
;;
|
|
|
|
|
64|64k|64K)
|
|
|
|
|
PAGESIZE=$((1024*64))
|
|
|
|
|
;;
|
|
|
|
|
*)
|
2023-02-27 20:45:25 +03:00
|
|
|
|
echo "Invalid page size '$2'"
|
2022-07-09 10:31:47 +03:00
|
|
|
|
exit -2
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2022-11-10 00:17:48 +03:00
|
|
|
|
--dont-check-ram-size)
|
|
|
|
|
DONT_CHECK_RAM=yes
|
|
|
|
|
;;
|
2023-02-27 20:45:25 +03:00
|
|
|
|
--extra)
|
|
|
|
|
EXTRA=yes
|
|
|
|
|
;;
|
2024-05-22 21:33:58 +03:00
|
|
|
|
--delay)
|
|
|
|
|
DELAY=$(($2))
|
|
|
|
|
shift
|
|
|
|
|
;;
|
2024-11-06 10:28:23 +03:00
|
|
|
|
--report-depth)
|
|
|
|
|
REPORT_DEPTH=yes
|
|
|
|
|
;;
|
2024-11-06 22:48:36 +03:00
|
|
|
|
--small)
|
|
|
|
|
SMALL=yes
|
|
|
|
|
;;
|
2021-07-05 18:27:27 +03:00
|
|
|
|
*)
|
|
|
|
|
echo "Unknown option '$1'"
|
|
|
|
|
exit -2
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
shift
|
|
|
|
|
done
|
|
|
|
|
|
2020-06-20 19:03:10 +03:00
|
|
|
|
set -euo pipefail
|
2021-07-05 18:27:27 +03:00
|
|
|
|
if [ -z "$MONITOR" ]; then
|
2021-01-15 14:50:42 +03:00
|
|
|
|
export MALLOC_CHECK_=7 MALLOC_PERTURB_=42
|
2019-10-10 22:11:28 +03:00
|
|
|
|
fi
|
|
|
|
|
|
2022-10-10 21:59:51 +03:00
|
|
|
|
if ! which $([ "$SKIP_MAKE" == "no" ] && echo make cc c++) tee >/dev/null; then
|
|
|
|
|
echo "Please install the following prerequisites: make cc c++ tee banner" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2021-07-06 22:27:23 +03:00
|
|
|
|
###############################################################################
|
|
|
|
|
# 1. clean data from prev runs and examine available RAM
|
|
|
|
|
|
2019-09-03 15:09:04 -07:00
|
|
|
|
WANNA_MOUNT=0
|
2019-08-10 23:04:00 +03:00
|
|
|
|
case ${UNAME} in
|
2020-05-24 20:37:55 +03:00
|
|
|
|
Linux)
|
|
|
|
|
MAKE=make
|
2021-07-06 22:27:23 +03:00
|
|
|
|
if [ -z "${TESTDB_DIR:-}" ]; then
|
|
|
|
|
for old_test_dir in $(ls -d /dev/shm/mdbx-test.[0-9]* 2>/dev/null); do
|
2020-05-24 20:37:55 +03:00
|
|
|
|
rm -rf $old_test_dir
|
|
|
|
|
done
|
|
|
|
|
TESTDB_DIR="/dev/shm/mdbx-test.$$"
|
|
|
|
|
fi
|
|
|
|
|
mkdir -p $TESTDB_DIR && rm -f $TESTDB_DIR/*
|
|
|
|
|
|
|
|
|
|
if LC_ALL=C free | grep -q -i available; then
|
2022-03-05 15:36:58 +03:00
|
|
|
|
ram_avail_mb=$(($(LC_ALL=C free | grep -i Mem: | tr -s '[:blank:]' ' ' | cut -d ' ' -f 7) / 1024))
|
2020-05-24 20:37:55 +03:00
|
|
|
|
else
|
2022-03-05 15:36:58 +03:00
|
|
|
|
ram_avail_mb=$(($(LC_ALL=C free | grep -i Mem: | tr -s '[:blank:]' ' ' | cut -d ' ' -f 4) / 1024))
|
2020-05-24 20:37:55 +03:00
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
FreeBSD)
|
|
|
|
|
MAKE=gmake
|
2021-07-06 22:27:23 +03:00
|
|
|
|
if [ -z "${TESTDB_DIR:-}" ]; then
|
|
|
|
|
for old_test_dir in $(ls -d /tmp/mdbx-test.[0-9]* 2>/dev/null); do
|
2020-05-24 20:37:55 +03:00
|
|
|
|
umount $old_test_dir && rm -r $old_test_dir
|
|
|
|
|
done
|
|
|
|
|
TESTDB_DIR="/tmp/mdbx-test.$$"
|
|
|
|
|
rm -rf $TESTDB_DIR && mkdir -p $TESTDB_DIR
|
|
|
|
|
WANNA_MOUNT=1
|
|
|
|
|
else
|
|
|
|
|
mkdir -p $TESTDB_DIR && rm -f $TESTDB_DIR/*
|
|
|
|
|
fi
|
|
|
|
|
ram_avail_mb=$(($(LC_ALL=C vmstat -s | grep -ie '[0-9] pages free$' | cut -d p -f 1) * ($(LC_ALL=C vmstat -s | grep -ie '[0-9] bytes per page$' | cut -d b -f 1) / 1024) / 1024))
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
Darwin)
|
|
|
|
|
MAKE=make
|
2021-07-06 22:27:23 +03:00
|
|
|
|
if [ -z "${TESTDB_DIR:-}" ]; then
|
|
|
|
|
for vol in $(ls -d /Volumes/mdx[0-9]*[0-9]tst 2>/dev/null); do
|
2020-05-24 20:37:55 +03:00
|
|
|
|
disk=$(mount | grep $vol | cut -d ' ' -f 1)
|
|
|
|
|
echo "umount: volume $vol disk $disk"
|
|
|
|
|
hdiutil unmount $vol -force
|
|
|
|
|
hdiutil detach $disk
|
|
|
|
|
done
|
|
|
|
|
TESTDB_DIR="/Volumes/mdx$$tst"
|
|
|
|
|
WANNA_MOUNT=1
|
|
|
|
|
else
|
|
|
|
|
mkdir -p $TESTDB_DIR && rm -f $TESTDB_DIR/*
|
|
|
|
|
fi
|
|
|
|
|
pagesize=$(($(LC_ALL=C vm_stat | grep -o 'page size of [0-9]\+ bytes' | cut -d' ' -f 4) / 1024))
|
|
|
|
|
freepages=$(LC_ALL=C vm_stat | grep '^Pages free:' | grep -o '[0-9]\+\.$' | cut -d'.' -f 1)
|
|
|
|
|
ram_avail_mb=$((pagesize * freepages / 1024))
|
|
|
|
|
echo "pagesize ${pagesize}K, freepages ${freepages}, ram_avail_mb ${ram_avail_mb}"
|
|
|
|
|
;;
|
|
|
|
|
|
2022-10-10 21:59:51 +03:00
|
|
|
|
MSYS*|MINGW*)
|
2022-11-08 20:12:05 +03:00
|
|
|
|
if [ -z "${TESTDB_DIR:-}" ]; then
|
|
|
|
|
for old_test_dir in $(ls -d /tmp/mdbx-test.[0-9]* 2>/dev/null); do
|
|
|
|
|
rm -rf $old_test_dir
|
|
|
|
|
done
|
|
|
|
|
TESTDB_DIR="/tmp/mdbx-test.$$"
|
|
|
|
|
fi
|
|
|
|
|
mkdir -p $TESTDB_DIR && rm -f $TESTDB_DIR/*
|
|
|
|
|
|
2022-10-10 21:59:51 +03:00
|
|
|
|
echo "FIXME: Fake support for ${UNAME}"
|
|
|
|
|
ram_avail_mb=32768
|
|
|
|
|
;;
|
|
|
|
|
|
2020-05-24 20:37:55 +03:00
|
|
|
|
*)
|
|
|
|
|
echo "FIXME: ${UNAME} not supported by this script"
|
|
|
|
|
exit 2
|
|
|
|
|
;;
|
2019-08-10 23:04:00 +03:00
|
|
|
|
esac
|
2019-06-24 01:34:45 +03:00
|
|
|
|
|
2024-08-11 00:23:08 +03:00
|
|
|
|
ulimit -c unlimited || echo "failed set unlimited core-dump size" >&2
|
2021-07-06 22:27:23 +03:00
|
|
|
|
rm -f ${TESTDB_DIR}/*
|
|
|
|
|
|
2019-09-03 15:09:04 -07:00
|
|
|
|
###############################################################################
|
|
|
|
|
# 2. estimate reasonable RAM space for test-db
|
|
|
|
|
|
2019-08-10 23:04:00 +03:00
|
|
|
|
echo "=== ${ram_avail_mb}M RAM available"
|
2022-11-10 00:17:48 +03:00
|
|
|
|
if [ $DONT_CHECK_RAM = yes ]; then
|
|
|
|
|
db_size_mb=$DB_UPTO_MB
|
|
|
|
|
ram_reserve4logs_mb=64
|
|
|
|
|
else
|
|
|
|
|
ram_reserve4logs_mb=1234
|
|
|
|
|
if [ $ram_avail_mb -lt $ram_reserve4logs_mb ]; then
|
|
|
|
|
echo "=== At least ${ram_reserve4logs_mb}Mb RAM required"
|
|
|
|
|
exit 3
|
|
|
|
|
fi
|
2019-06-24 01:34:45 +03:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# В режимах отличных от MDBX_WRITEMAP изменения до записи в файл
|
|
|
|
|
# будут накапливаться в памяти, что может потребовать свободной
|
|
|
|
|
# памяти размером с БД. Кроме этого, в тест входит сценарий
|
|
|
|
|
# создания копия БД на ходу. Поэтому БД не может быть больше 1/3
|
|
|
|
|
# от доступной памяти. Однако, следует учесть что malloc() будет
|
|
|
|
|
# не сразу возвращать выделенную память системе, а также
|
|
|
|
|
# предусмотреть места для логов.
|
|
|
|
|
#
|
|
|
|
|
# In non-MDBX_WRITEMAP modes, updates (dirty pages) will
|
|
|
|
|
# accumulate in memory before writing to the disk, which may
|
|
|
|
|
# require a free memory up to the size of a whole database. In
|
|
|
|
|
# addition, the test includes a script create a copy of the
|
|
|
|
|
# database on the go. Therefore, the database cannot be more 1/3
|
|
|
|
|
# of available memory. Moreover, should be taken into account
|
|
|
|
|
# that malloc() will not return the allocated memory to the
|
|
|
|
|
# system immediately, as well some space is required for logs.
|
|
|
|
|
#
|
2022-11-10 00:17:48 +03:00
|
|
|
|
db_size_mb=$(((ram_avail_mb - ram_reserve4logs_mb) / 4))
|
|
|
|
|
if [ $db_size_mb -gt $DB_UPTO_MB ]; then
|
|
|
|
|
db_size_mb=$DB_UPTO_MB
|
|
|
|
|
fi
|
2019-06-27 10:53:35 +03:00
|
|
|
|
fi
|
2019-08-10 23:04:00 +03:00
|
|
|
|
echo "=== use ${db_size_mb}M for DB"
|
2019-06-24 01:34:45 +03:00
|
|
|
|
|
2019-09-03 15:09:04 -07:00
|
|
|
|
###############################################################################
|
|
|
|
|
# 3. Create test-directory in ramfs/tmpfs, i.e. create/format/mount if required
|
|
|
|
|
case ${UNAME} in
|
2020-05-24 20:37:55 +03:00
|
|
|
|
Linux)
|
2021-12-12 12:01:51 +03:00
|
|
|
|
ulimit -c unlimited
|
|
|
|
|
if [ "$(cat /proc/sys/kernel/core_pattern)" != "core.%p" ]; then
|
|
|
|
|
echo "core.%p > /proc/sys/kernel/core_pattern" >&2
|
2022-10-13 17:56:42 +03:00
|
|
|
|
if [ $(id -u) -ne 0 -a -n "$(which sudo 2>/dev/null)" ]; then
|
|
|
|
|
echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true
|
|
|
|
|
else
|
|
|
|
|
(echo "core.%p" > /proc/sys/kernel/core_pattern) || true
|
|
|
|
|
fi
|
2021-12-12 12:01:51 +03:00
|
|
|
|
fi
|
2020-05-24 20:37:55 +03:00
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
FreeBSD)
|
|
|
|
|
if [[ WANNA_MOUNT ]]; then
|
|
|
|
|
mount -t tmpfs tmpfs $TESTDB_DIR
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
Darwin)
|
|
|
|
|
if [[ WANNA_MOUNT ]]; then
|
|
|
|
|
ramdisk_size_mb=$((42 + db_size_mb * 2 + ram_reserve4logs_mb))
|
|
|
|
|
number_of_sectors=$((ramdisk_size_mb * 2048))
|
|
|
|
|
ramdev=$(hdiutil attach -nomount ram://${number_of_sectors})
|
|
|
|
|
diskutil erasevolume ExFAT "mdx$$tst" ${ramdev}
|
|
|
|
|
fi
|
|
|
|
|
;;
|
2022-10-10 21:59:51 +03:00
|
|
|
|
|
|
|
|
|
MSYS*|MINGW*)
|
|
|
|
|
echo "FIXME: Fake support for ${UNAME}"
|
|
|
|
|
;;
|
2020-05-24 20:37:55 +03:00
|
|
|
|
|
|
|
|
|
*)
|
|
|
|
|
echo "FIXME: ${UNAME} not supported by this script"
|
|
|
|
|
exit 2
|
|
|
|
|
;;
|
2019-09-03 15:09:04 -07:00
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
2021-07-05 18:27:27 +03:00
|
|
|
|
# 4. build the test executables
|
2019-09-03 15:09:04 -07:00
|
|
|
|
|
2021-07-05 18:27:27 +03:00
|
|
|
|
if [ "$SKIP_MAKE" != "yes" ]; then
|
|
|
|
|
${MAKE} -j$(which nproc >/dev/null 2>/dev/null && nproc || echo 2) build-test
|
|
|
|
|
fi
|
2019-06-24 01:34:45 +03:00
|
|
|
|
|
|
|
|
|
###############################################################################
|
2019-09-03 15:09:04 -07:00
|
|
|
|
# 5. run stochastic iterations
|
2019-06-24 01:34:45 +03:00
|
|
|
|
|
2024-11-05 15:19:58 +03:00
|
|
|
|
if which setsid >/dev/null 2>/dev/null; then
|
|
|
|
|
SETSID=$(which setsid)
|
|
|
|
|
else
|
|
|
|
|
SETSID=""
|
|
|
|
|
fi
|
|
|
|
|
|
2021-07-06 22:27:23 +03:00
|
|
|
|
if which lz4 >/dev/null; then
|
|
|
|
|
function logger {
|
2024-11-05 15:19:58 +03:00
|
|
|
|
${SETSID} lz4 -z -c > ${TESTDB_DIR}/long.log.lz4 || echo "FAILED 'lz4 -z -c > ${TESTDB_DIR}/long.log.lz4'" >&2
|
2021-07-06 22:27:23 +03:00
|
|
|
|
}
|
2023-10-30 12:25:05 +03:00
|
|
|
|
function taillog {
|
|
|
|
|
if [ -s ${TESTDB_DIR}/long.log.lz4 ]; then
|
|
|
|
|
echo "=============================================== last ${TAILLOG} lines"
|
|
|
|
|
lz4 -d -c ${TESTDB_DIR}/long.log.lz4 | tail -n ${TAILLOG}
|
|
|
|
|
else
|
|
|
|
|
echo "=============================================== no test log"
|
|
|
|
|
fi
|
|
|
|
|
}
|
2021-07-06 22:27:23 +03:00
|
|
|
|
elif which gzip >/dev/null; then
|
|
|
|
|
function logger {
|
2024-11-05 15:19:58 +03:00
|
|
|
|
${SETSID} gzip -c -k > ${TESTDB_DIR}/long.log.gz || echo "FAILED 'gzip -c -k > ${TESTDB_DIR}/long.log.gz'" >&2
|
2021-07-06 22:27:23 +03:00
|
|
|
|
}
|
2023-10-30 12:25:05 +03:00
|
|
|
|
function taillog {
|
|
|
|
|
if [ -s ${TESTDB_DIR}/long.log.gz ]; then
|
|
|
|
|
echo "=============================================== last ${TAILLOG} lines"
|
|
|
|
|
gzip -d -c ${TESTDB_DIR}/long.log.gz | tail -n ${TAILLOG}
|
|
|
|
|
else
|
|
|
|
|
echo "=============================================== no test log"
|
|
|
|
|
fi
|
|
|
|
|
}
|
2021-07-06 22:27:23 +03:00
|
|
|
|
else
|
|
|
|
|
function logger {
|
2024-11-05 15:19:58 +03:00
|
|
|
|
cat > ${TESTDB_DIR}/long.log || echo "FAILED 'cat > ${TESTDB_DIR}/long.log'" >&2
|
2021-07-06 22:27:23 +03:00
|
|
|
|
}
|
2023-10-30 12:25:05 +03:00
|
|
|
|
function taillog {
|
|
|
|
|
if [ -s ${TESTDB_DIR}/long.log ]; then
|
|
|
|
|
echo "=============================================== last ${TAILLOG} lines"
|
|
|
|
|
tail -n ${TAILLOG} ${TESTDB_DIR}/long.log
|
|
|
|
|
else
|
|
|
|
|
echo "=============================================== no test log"
|
|
|
|
|
fi
|
|
|
|
|
}
|
2021-07-06 22:27:23 +03:00
|
|
|
|
fi
|
2019-06-24 01:34:45 +03:00
|
|
|
|
|
2023-02-27 20:45:25 +03:00
|
|
|
|
if [ "$EXTRA" != "no" ]; then
|
2024-06-12 17:31:05 +03:00
|
|
|
|
options=(perturb nomeminit nordahead writemap lifo nostickythreads)
|
2023-02-27 20:45:25 +03:00
|
|
|
|
else
|
2024-04-02 00:22:09 +03:00
|
|
|
|
options=(writemap lifo nostickythreads)
|
2023-02-27 20:45:25 +03:00
|
|
|
|
fi
|
2023-02-27 15:17:22 +03:00
|
|
|
|
syncmodes=("" ,+nosync-safe ,+nosync-utterly ,+nometasync)
|
2021-07-06 22:27:23 +03:00
|
|
|
|
function join { local IFS="$1"; shift; echo "$*"; }
|
|
|
|
|
|
|
|
|
|
function bits2options {
|
|
|
|
|
local bits=$1
|
2020-05-24 20:37:55 +03:00
|
|
|
|
local i
|
|
|
|
|
local list=()
|
2021-07-06 22:27:23 +03:00
|
|
|
|
for ((i = 0; i < ${#options[@]}; ++i)); do
|
|
|
|
|
list[$i]=$( (( (bits & (1 << i)) != 0 )) && echo -n '+' || echo -n '-'; echo ${options[$i]})
|
2020-05-24 20:37:55 +03:00
|
|
|
|
done
|
2021-07-06 22:27:23 +03:00
|
|
|
|
join , ${list[@]}
|
2019-06-24 01:34:45 +03:00
|
|
|
|
}
|
|
|
|
|
|
2024-11-05 15:19:58 +03:00
|
|
|
|
LFD=0
|
|
|
|
|
trap "echo 'SIGPIPE(ignored)'" SIGPIPE
|
|
|
|
|
|
2021-07-05 18:27:27 +03:00
|
|
|
|
function failed {
|
2024-11-05 15:19:58 +03:00
|
|
|
|
set +euo pipefail
|
2021-07-05 18:27:27 +03:00
|
|
|
|
echo "FAILED" >&2
|
2024-11-05 15:19:58 +03:00
|
|
|
|
if [ ${LFD} -ne 0 ]; then
|
|
|
|
|
sleep 0.05
|
|
|
|
|
echo "@@@ END-OF-LOG/FAILED" >&${LFD}
|
|
|
|
|
sleep 0.05
|
|
|
|
|
exec {LFD}>&-
|
|
|
|
|
LFD=0
|
|
|
|
|
fi
|
2023-10-30 12:25:05 +03:00
|
|
|
|
if [ ${TAILLOG} -gt 0 ]; then
|
|
|
|
|
taillog
|
|
|
|
|
fi
|
2021-07-05 18:27:27 +03:00
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-05 15:19:58 +03:00
|
|
|
|
function on_exit {
|
|
|
|
|
set +euo pipefail
|
|
|
|
|
if [ ${LFD} -ne 0 ]; then
|
|
|
|
|
sleep 0.05
|
|
|
|
|
echo "@@@ END-OF-LOG/EXIT" >&${LFD}
|
|
|
|
|
sleep 0.05
|
|
|
|
|
exec {LFD}>&-
|
|
|
|
|
LFD=0
|
2021-07-05 18:27:27 +03:00
|
|
|
|
fi
|
2024-11-05 15:19:58 +03:00
|
|
|
|
echo "--- EXIT" >&2
|
2021-07-05 18:27:27 +03:00
|
|
|
|
}
|
2024-11-05 15:19:58 +03:00
|
|
|
|
trap on_exit EXIT
|
2021-07-05 18:27:27 +03:00
|
|
|
|
|
2019-06-24 01:34:45 +03:00
|
|
|
|
function probe {
|
2020-05-26 15:11:32 +03:00
|
|
|
|
echo "----------------------------------------------- $(date)"
|
2024-11-06 13:42:33 +03:00
|
|
|
|
echo "PROBE №${caption}"
|
2021-07-05 18:27:27 +03:00
|
|
|
|
rm -f ${TESTDB_DIR}/* || failed
|
|
|
|
|
for case in $LIST
|
|
|
|
|
do
|
2024-11-06 22:48:36 +03:00
|
|
|
|
echo "${speculum} --random-writemap=no --ignore-dbfull --repeat=${REPEAT} --pathname=${TESTDB_DIR}/long.db --cleanup-after=no --geometry-jitter=${GEOMETRY_JITTER} $@ $case"
|
2024-11-06 10:28:23 +03:00
|
|
|
|
if [[ ${REPORT_DEPTH} = "yes" && ($case = "basic" || $case = "--hill") ]]; then
|
2024-11-06 11:19:32 +03:00
|
|
|
|
if [ -z "${TEE4PIPE:-}" ]; then
|
|
|
|
|
TEE4PIPE=$(tee --help | grep -q ' -p' && echo "tee -i -p" || echo "tee -i")
|
|
|
|
|
fi
|
|
|
|
|
exec {LFD}> >(${TEE4PIPE} >(logger) | grep -e reach -e achieve)
|
2024-11-05 15:19:58 +03:00
|
|
|
|
else
|
|
|
|
|
exec {LFD}> >(logger)
|
|
|
|
|
fi
|
2024-11-06 22:48:36 +03:00
|
|
|
|
${MONITOR} ./mdbx_test ${speculum} --random-writemap=no --ignore-dbfull --repeat=${REPEAT} --pathname=${TESTDB_DIR}/long.db --cleanup-after=no --geometry-jitter=${GEOMETRY_JITTER} "$@" $case >&${LFD} \
|
2024-11-06 13:42:33 +03:00
|
|
|
|
&& ${MONITOR} ./mdbx_chk -q ${TESTDB_DIR}/long.db | tee ${TESTDB_DIR}/long-chk.log \
|
|
|
|
|
&& ([ ! -e ${TESTDB_DIR}/long.db-copy ] || ${MONITOR} ./mdbx_chk -q ${TESTDB_DIR}/long.db-copy | tee ${TESTDB_DIR}/long-chk-copy.log) \
|
2021-07-05 18:27:27 +03:00
|
|
|
|
|| failed
|
2024-11-05 15:19:58 +03:00
|
|
|
|
if [ ${LFD} -ne 0 ]; then
|
|
|
|
|
echo "@@@ END-OF-LOG/ITERATION" >&${LFD}
|
|
|
|
|
exec {LFD}>&-
|
|
|
|
|
LFD=0
|
|
|
|
|
fi
|
|
|
|
|
done
|
2019-06-24 01:34:45 +03:00
|
|
|
|
}
|
|
|
|
|
|
2024-11-06 22:48:36 +03:00
|
|
|
|
function pass {
|
|
|
|
|
for ((round=1; round <= ROUNDS; ++round)); do
|
2020-05-26 15:11:32 +03:00
|
|
|
|
echo "======================================================================="
|
2024-11-06 22:48:36 +03:00
|
|
|
|
if [[ $ROUNDS > 1 ]]; then
|
|
|
|
|
${BANNER} "$nops / $wbatch / round $round of $ROUNDS"
|
|
|
|
|
else
|
|
|
|
|
${BANNER} "$nops / $wbatch"
|
|
|
|
|
fi
|
2020-05-24 20:37:55 +03:00
|
|
|
|
subcase=0
|
|
|
|
|
for ((bits=2**${#options[@]}; --bits >= 0; )); do
|
|
|
|
|
seed=$(($(date +%s) + RANDOM))
|
|
|
|
|
|
|
|
|
|
split=30
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2020-05-24 20:37:55 +03:00
|
|
|
|
|
|
|
|
|
split=24
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
|
|
|
|
|
2020-05-24 20:37:55 +03:00
|
|
|
|
split=16
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2023-02-27 15:17:22 +03:00
|
|
|
|
|
2023-02-27 20:45:25 +03:00
|
|
|
|
if [ "$EXTRA" != "no" ]; then
|
|
|
|
|
split=10
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2023-02-27 20:45:25 +03:00
|
|
|
|
fi
|
2020-05-24 20:37:55 +03:00
|
|
|
|
|
|
|
|
|
split=4
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-03-03 17:38:23 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) int-key,fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+key.integer,+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2024-11-06 13:42:33 +03:00
|
|
|
|
caption="$((++count)) fixdups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
2024-02-20 13:47:44 +03:00
|
|
|
|
--prng-seed=${seed} --pagesize=$PAGESIZE --size-upper-upto=${db_size_mb}M --table=+data.fixed --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen=rnd \
|
|
|
|
|
--nops=$nops --batch.write=$wbatch --mode=$(bits2options $bits)${syncmodes[count%4]}
|
2020-05-24 20:37:55 +03:00
|
|
|
|
done # options
|
|
|
|
|
cases="${subcase}"
|
2024-11-06 22:48:36 +03:00
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
if [ "$DELAY" != "0" ]; then
|
|
|
|
|
sleep $DELAY
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
count=0
|
|
|
|
|
loop=0
|
|
|
|
|
cases='?'
|
|
|
|
|
if [[ $SMALL != "yes" ]]; then
|
|
|
|
|
for nops in 10 33 100 333 1000 3333 10000 33333 100000 333333 1000000 3333333 10000000 33333333 100000000 333333333 1000000000; do
|
|
|
|
|
if [ $nops -lt $FROM ]; then continue; fi
|
|
|
|
|
if [ $nops -gt $UPTO ]; then echo "The '--upto $UPTO' limit reached"; break; fi
|
|
|
|
|
if [ -n "$LOOPS" ] && [ $loop -ge "$LOOPS" ]; then echo "The '--loops $LOOPS' limit reached"; break; fi
|
|
|
|
|
echo "======================================================================="
|
|
|
|
|
wbatch=$((nops / 7 + 1))
|
|
|
|
|
speculum=$([ $nops -le 1000 ] && echo '--speculum' || true)
|
|
|
|
|
while true; do
|
|
|
|
|
pass
|
|
|
|
|
loop=$((loop + 1))
|
|
|
|
|
if [ -n "$LOOPS" ] && [ $loop -ge "$LOOPS" ]; then break; fi
|
|
|
|
|
wbatch=$(((wbatch > 7) ? wbatch / 7 : 1))
|
|
|
|
|
if [ $wbatch -eq 1 -o $((nops / wbatch)) -gt 1000 ]; then break; fi
|
|
|
|
|
done # batch (write-ops per txn)
|
|
|
|
|
done # n-ops
|
|
|
|
|
else
|
|
|
|
|
for ((wbatch=FROM; wbatch<=UPTO; ++wbatch)); do
|
|
|
|
|
if [ -n "$LOOPS" ] && [ $loop -ge "$LOOPS" ]; then echo "The '--loops $LOOPS' limit reached"; break; fi
|
|
|
|
|
echo "======================================================================="
|
|
|
|
|
speculum=$([ $wbatch -le 1000 ] && echo '--speculum' || true)
|
|
|
|
|
nops=$((wbatch / 7 + 1))
|
|
|
|
|
pass
|
|
|
|
|
loop=$((loop + 1))
|
|
|
|
|
done # wbatch
|
|
|
|
|
fi
|
2019-06-24 01:34:45 +03:00
|
|
|
|
|
|
|
|
|
echo "=== ALL DONE ====================== $(date)"
|