mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
31 lines
954 B
Bash
Executable File
31 lines
954 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
. $CURDIR/../shell_config.sh
|
|
|
|
|
|
R1=table_1013_1
|
|
R2=table_1013_2
|
|
|
|
${CLICKHOUSE_CLIENT} -n -q "
|
|
DROP TABLE IF EXISTS $R1;
|
|
DROP TABLE IF EXISTS $R2;
|
|
|
|
CREATE TABLE $R1 (x UInt32) ENGINE ReplicatedMergeTree('/clickhouse/tables/${CLICKHOUSE_DATABASE}.table_1013', 'r1') ORDER BY x;
|
|
CREATE TABLE $R2 (x UInt32) ENGINE ReplicatedMergeTree('/clickhouse/tables/${CLICKHOUSE_DATABASE}.table_1013', 'r2') ORDER BY x;
|
|
|
|
SYSTEM STOP FETCHES $R2;
|
|
INSERT INTO $R1 VALUES (1)
|
|
"
|
|
|
|
timeout 10s ${CLICKHOUSE_CLIENT} -n -q "
|
|
SET receive_timeout=1;
|
|
SYSTEM SYNC REPLICA $R2
|
|
" 2>&1 | fgrep -q "DB::Exception: SYNC REPLICA ${CLICKHOUSE_DATABASE}.$R2: command timed out!" && echo 'OK' || echo 'Failed!'
|
|
|
|
# By dropping tables all related SYNC REPLICA queries would be terminated as well
|
|
${CLICKHOUSE_CLIENT} -n -q "
|
|
DROP TABLE IF EXISTS $R2;
|
|
DROP TABLE IF EXISTS $R1;
|
|
"
|