ClickHouse/tests/queries/0_stateless/01305_replica_create_drop_zookeeper.sh

27 lines
1.1 KiB
Bash
Raw Normal View History

2020-06-11 03:27:20 +00:00
#!/usr/bin/env bash
2021-09-12 12:35:27 +00:00
# Tags: replica, no-parallel, no-fasttest
2020-06-11 03:27:20 +00:00
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
2020-06-11 03:27:20 +00:00
set -e
function thread()
{
$CLICKHOUSE_CLIENT -n -q "DROP TABLE IF EXISTS test_table_$1 SYNC;
CREATE TABLE test_table_$1 (a UInt8) ENGINE = ReplicatedMergeTree('/clickhouse/tables/$CLICKHOUSE_TEST_ZOOKEEPER_PREFIX/alter_table', 'r_$1') ORDER BY tuple();" 2>&1 |
grep -vP '(^$)|(^Received exception from server)|(^\d+\. )|because the last replica of the table was dropped right now|is already started to be removing by another replica right now| were removed by another replica|Removing leftovers from table|Another replica was suddenly created|was created by another server at the same moment|was suddenly removed|some other replicas were created at the same time|^\(query: '
2020-06-11 03:27:20 +00:00
}
export -f thread
2020-06-11 03:27:20 +00:00
TIMEOUT=10
clickhouse_client_loop_timeout $TIMEOUT thread 1 &
clickhouse_client_loop_timeout $TIMEOUT thread 2 &
2020-06-11 03:27:20 +00:00
wait
for i in {1,2}; do $CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS test_table_$i"; done