ClickHouse/tests/queries/0_stateless/01516_drop_table_stress_long.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.9 KiB
Bash
Raw Normal View History

2020-10-06 20:23:51 +00:00
#!/usr/bin/env bash
2022-11-21 11:24:00 +00:00
# Tags: long, no-debug
2020-10-06 20:23:51 +00:00
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
2020-12-28 11:46:53 +00:00
# shellcheck source=../shell_config.sh
2020-10-06 20:23:51 +00:00
. "$CURDIR"/../shell_config.sh
export CURR_DATABASE="test_01516_${CLICKHOUSE_DATABASE}"
2020-10-06 20:23:51 +00:00
function drop_database()
{
# redirect stderr since it is racy with DROP TABLE
# and tries to remove ${CURR_DATABASE}.data too.
2022-11-21 11:38:51 +00:00
${CLICKHOUSE_CLIENT} --fsync_metadata=0 -q "DROP DATABASE IF EXISTS ${CURR_DATABASE}" 2>/dev/null
2020-10-06 20:23:51 +00:00
}
trap drop_database EXIT
2020-10-06 20:23:51 +00:00
function drop_table()
{
2022-11-21 11:38:51 +00:00
${CLICKHOUSE_CLIENT} --fsync_metadata=0 -q "DROP TABLE IF EXISTS ${CURR_DATABASE}.data3;" 2>&1 | grep -F "Code: " | grep -Fv "is currently dropped or renamed"
${CLICKHOUSE_CLIENT} --fsync_metadata=0 -q "DROP TABLE IF EXISTS ${CURR_DATABASE}.data1;" 2>&1 | grep -F "Code: " | grep -Fv "is currently dropped or renamed"
${CLICKHOUSE_CLIENT} --fsync_metadata=0 -q "DROP TABLE IF EXISTS ${CURR_DATABASE}.data2;" 2>&1 | grep -F "Code: " | grep -Fv "is currently dropped or renamed"
2020-10-06 20:23:51 +00:00
}
function create()
{
2022-11-21 11:38:51 +00:00
${CLICKHOUSE_CLIENT} --fsync_metadata=0 -q "CREATE DATABASE IF NOT EXISTS ${CURR_DATABASE};"
${CLICKHOUSE_CLIENT} --fsync_metadata=0 -q "CREATE TABLE IF NOT EXISTS ${CURR_DATABASE}.data1 Engine=MergeTree() ORDER BY number AS SELECT * FROM numbers(1);" 2>&1 | grep -F "Code: " | grep -Fv "is currently dropped or renamed"
${CLICKHOUSE_CLIENT} --fsync_metadata=0 -q "CREATE TABLE IF NOT EXISTS ${CURR_DATABASE}.data2 Engine=MergeTree() ORDER BY number AS SELECT * FROM numbers(1);" 2>&1 | grep -F "Code: " | grep -Fv "is currently dropped or renamed"
${CLICKHOUSE_CLIENT} --fsync_metadata=0 -q "CREATE TABLE IF NOT EXISTS ${CURR_DATABASE}.data3 Engine=MergeTree() ORDER BY number AS SELECT * FROM numbers(1);" 2>&1 | grep -F "Code: " | grep -Fv "is currently dropped or renamed"
2020-10-06 20:23:51 +00:00
}
2022-11-21 11:24:00 +00:00
for _ in {1..25}; do
2020-10-06 20:23:51 +00:00
create
drop_table &
drop_database &
wait
done