mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
1792b23a2c
CI report [1]: 2021-09-13 09:55:27 Code: 219. DB::Exception: Received from localhost:9000. DB::Exception: New table appeared in database being dropped or detached. Try again.. (DATABASE_NOT_EMPTY) 2021-09-13 09:55:27 Code: 82. DB::Exception: Received from localhost:9000. DB::Exception: Database test_01150 already exists.. (DATABASE_ALREADY_EXISTS) [1]: https://clickhouse-test-reports.s3.yandex.net/0/abe314feecd1647d7c2b952a25da7abf5c19f352/functional_stateless_tests_(release,_databaseordinary)/test_run.txt.out.log
47 lines
2.0 KiB
Bash
Executable File
47 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Tags: no-parallel
|
|
|
|
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=fatal
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
# shellcheck source=../shell_config.sh
|
|
. "$CURDIR"/../shell_config.sh
|
|
|
|
$CLICKHOUSE_CLIENT --query "DROP DATABASE IF EXISTS test_01150"
|
|
$CLICKHOUSE_CLIENT --query "CREATE DATABASE test_01150"
|
|
|
|
$CLICKHOUSE_CLIENT --query "CREATE TABLE test_01150.t1 (x UInt64, s Array(Nullable(String))) ENGINE = Memory"
|
|
$CLICKHOUSE_CLIENT --query "CREATE TABLE test_01150.t2 (x UInt64, s Array(Nullable(String))) ENGINE = Memory"
|
|
|
|
function thread_detach_attach {
|
|
while true; do
|
|
$CLICKHOUSE_CLIENT --query "DETACH DATABASE test_01150" 2>&1 | grep -v -F -e 'Received exception from server' -e 'Code: 219' -e '(query: '
|
|
sleep 0.0$RANDOM
|
|
$CLICKHOUSE_CLIENT --query "ATTACH DATABASE test_01150" 2>&1 | grep -v -F -e 'Received exception from server' -e 'Code: 82' -e '(query: '
|
|
sleep 0.0$RANDOM
|
|
done
|
|
}
|
|
|
|
function thread_rename {
|
|
while true; do
|
|
$CLICKHOUSE_CLIENT --query "RENAME TABLE test_01150.t1 TO test_01150.t2_tmp, test_01150.t2 TO test_01150.t1, test_01150.t2_tmp TO test_01150.t2" 2>&1 | grep -v -F -e 'Received exception from server' -e '(query: ' | grep -v -P 'Code: (81|60|57|521)'
|
|
sleep 0.0$RANDOM
|
|
$CLICKHOUSE_CLIENT --query "RENAME TABLE test_01150.t2 TO test_01150.t1, test_01150.t2_tmp TO test_01150.t2" 2>&1 | grep -v -F -e 'Received exception from server' -e '(query: ' | grep -v -P 'Code: (81|60|57|521)'
|
|
sleep 0.0$RANDOM
|
|
$CLICKHOUSE_CLIENT --query "RENAME TABLE test_01150.t2_tmp TO test_01150.t2" 2>&1 | grep -v -F -e 'Received exception from server' -e '(query: ' | grep -v -P 'Code: (81|60|57|521)'
|
|
sleep 0.0$RANDOM
|
|
done
|
|
}
|
|
|
|
export -f thread_detach_attach
|
|
export -f thread_rename
|
|
|
|
timeout 20 bash -c "thread_detach_attach" &
|
|
timeout 20 bash -c 'thread_rename' &
|
|
wait
|
|
sleep 1
|
|
|
|
$CLICKHOUSE_CLIENT --query "DETACH DATABASE IF EXISTS test_01150"
|
|
$CLICKHOUSE_CLIENT --query "ATTACH DATABASE IF NOT EXISTS test_01150"
|
|
$CLICKHOUSE_CLIENT --query "DROP DATABASE test_01150"
|