mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Adjusted timings in test + more verbose diagnostics
This commit is contained in:
parent
90c9d83fa5
commit
2d807368e1
@ -342,9 +342,12 @@ void InterpreterSystemQuery::syncReplica(ASTSystemQuery & query)
|
||||
{
|
||||
LOG_TRACE(log, "Synchronizing entries in replica's queue with table's log and waiting for it to become empty");
|
||||
if (!storage_replicated->waitForShrinkingQueueSize(0, context.getSettingsRef().receive_timeout.totalMilliseconds()))
|
||||
{
|
||||
LOG_ERROR(log, "SYNC REPLICA " + database_name + "." + table_name + ": Timed out!");
|
||||
throw Exception(
|
||||
"SYNC REPLICA " + database_name + "." + table_name + ": command timed out! "
|
||||
"See the 'receive_timeout' setting", ErrorCodes::TIMEOUT_EXCEEDED);
|
||||
}
|
||||
LOG_TRACE(log, "SYNC REPLICA " + database_name + "." + table_name + ": OK");
|
||||
}
|
||||
else
|
||||
|
@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
|
||||
${CLICKHOUSE_CLIENT} -n -q "
|
||||
CREATE TABLE table_1013_1 (x UInt32) ENGINE ReplicatedMergeTree('/clickhouse/tables/${CLICKHOUSE_DATABASE}.table_1013', 'r1') ORDER BY x;
|
||||
CREATE TABLE table_1013_2 (x UInt32) ENGINE ReplicatedMergeTree('/clickhouse/tables/${CLICKHOUSE_DATABASE}.table_1013', 'r2') ORDER BY x;
|
||||
|
||||
SYSTEM STOP FETCHES table_1013_2;
|
||||
INSERT INTO table_1013_1 VALUES (1)
|
||||
"
|
||||
|
||||
timeout 2s ${CLICKHOUSE_CLIENT} -n -q "SET receive_timeout=1; SYSTEM SYNC REPLICA table_1013_2" 2>&1 \
|
||||
| fgrep -q "DB::Exception: SYNC REPLICA ${CLICKHOUSE_DATABASE}.table_1013_2: command timed out!" \
|
||||
&& echo 'OK' \
|
||||
|| (${CLICKHOUSE_CLIENT} -q "KILL QUERY WHERE query = 'SYSTEM SYNC REPLICA table_1013_2'"; echo "Failed!")
|
||||
|
||||
${CLICKHOUSE_CLIENT} -n -q "
|
||||
DROP TABLE IF EXISTS table_1013_2;
|
||||
DROP TABLE IF EXISTS table_1013_1;"
|
30
dbms/tests/queries/0_stateless/01013_sync_replica_timeout_zookeeper.sh
Executable file
30
dbms/tests/queries/0_stateless/01013_sync_replica_timeout_zookeeper.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/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;
|
||||
"
|
Loading…
Reference in New Issue
Block a user