2018-11-28 19:09:17 +00:00
#!/usr/bin/env bash
2024-07-02 12:15:59 +00:00
# Tags: long, no-object-storage, no-msan, no-asan, no-tsan, no-debug
2024-06-29 13:48:44 +00:00
# Some kind of stress test, it doesn't make sense to test in a non-release build
2021-09-12 12:35:27 +00:00
2018-11-28 19:09:17 +00:00
set -e
CURDIR = $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd )
2020-12-28 11:46:53 +00:00
# shellcheck source=../shell_config.sh
2020-08-01 00:51:12 +00:00
. " $CURDIR " /../shell_config.sh
2018-11-28 19:09:17 +00:00
2020-05-29 10:08:11 +00:00
${ CLICKHOUSE_CLIENT } --query= "DROP TABLE IF EXISTS mt_00763_2"
${ CLICKHOUSE_CLIENT } --query= "DROP TABLE IF EXISTS buffer_00763_2"
2018-11-28 19:09:17 +00:00
2020-05-29 10:08:11 +00:00
${ CLICKHOUSE_CLIENT } --query= " CREATE TABLE buffer_00763_2 (s String) ENGINE = Buffer(' $CLICKHOUSE_DATABASE ', mt_00763_2, 1, 1, 1, 1, 1, 1, 1) "
2018-11-28 19:09:17 +00:00
function thread1( )
{
2024-07-29 20:06:55 +00:00
seq 1 500 | sed -r -e 's/.+/DROP TABLE IF EXISTS mt_00763_2; CREATE TABLE mt_00763_2 (s String) ENGINE = MergeTree ORDER BY s; INSERT INTO mt_00763_2 SELECT toString(number) FROM numbers(10);/' | ${ CLICKHOUSE_CLIENT } --fsync-metadata 0 --ignore-error || :
2018-11-28 19:09:17 +00:00
}
function thread2( )
{
2024-07-29 20:06:55 +00:00
seq 1 500 | sed -r -e 's/.+/SELECT count() FROM buffer_00763_2;/' | ${ CLICKHOUSE_CLIENT } --server_logs_file= '/dev/null' --ignore-error 2>& 1 | grep -vP '^0$|^10$|^Received exception|^Code: 60|^Code: 218|^Code: 473' | grep -v '(query: '
2018-11-28 19:09:17 +00:00
}
thread1 &
thread2 &
wait
2020-05-29 10:08:11 +00:00
${ CLICKHOUSE_CLIENT } --query= "DROP TABLE mt_00763_2"
${ CLICKHOUSE_CLIENT } --query= "DROP TABLE buffer_00763_2"