mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #18897 from azat/stress-tests-no-restart-replicas
Drop RESTART REPLICAS from stateless tests to avoid locking lots of mutexes
This commit is contained in:
commit
f8473222c6
@ -467,8 +467,11 @@ void InterpreterSystemQuery::restartReplicas(Context & system_context)
|
||||
guard.second = catalog.getDDLGuard(guard.first.database_name, guard.first.table_name);
|
||||
|
||||
ThreadPool pool(std::min(size_t(getNumberOfPhysicalCPUCores()), replica_names.size()));
|
||||
for (auto & table : replica_names)
|
||||
pool.scheduleOrThrowOnError([&]() { tryRestartReplica(table, system_context, false); });
|
||||
for (auto & replica : replica_names)
|
||||
{
|
||||
LOG_TRACE(log, "Restarting replica on {}", replica.getNameForLogs());
|
||||
pool.scheduleOrThrowOnError([&]() { tryRestartReplica(replica, system_context, false); });
|
||||
}
|
||||
pool.wait();
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ $CLICKHOUSE_CLIENT --query="SELECT count(), sum(d), uniqExact(_part) FROM dst_r2
|
||||
|
||||
$CLICKHOUSE_CLIENT --query="SELECT 'After restart';"
|
||||
$CLICKHOUSE_CLIENT --query="SYSTEM RESTART REPLICA dst_r1;"
|
||||
$CLICKHOUSE_CLIENT --query="SYSTEM RESTART REPLICAS;"
|
||||
$CLICKHOUSE_CLIENT --query="SYSTEM RESTART REPLICA dst_r2;"
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count(), sum(d) FROM dst_r1;"
|
||||
$CLICKHOUSE_CLIENT --query="SELECT count(), sum(d) FROM dst_r2;"
|
||||
|
||||
|
@ -19,7 +19,7 @@ function rename_thread_1()
|
||||
replica_01108_3 TO replica_01108_3_tmp,
|
||||
replica_01108_4 TO replica_01108_4_tmp";
|
||||
sleep 0.$RANDOM;
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
function rename_thread_2()
|
||||
@ -30,23 +30,27 @@ function rename_thread_2()
|
||||
replica_01108_3_tmp TO replica_01108_4,
|
||||
replica_01108_4_tmp TO replica_01108_1";
|
||||
sleep 0.$RANDOM;
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
function restart_thread_1()
|
||||
function restart_replicas_loop()
|
||||
{
|
||||
while true; do
|
||||
$CLICKHOUSE_CLIENT -q "SYSTEM RESTART REPLICAS";
|
||||
sleep 0.$RANDOM;
|
||||
for i in $(seq 4); do
|
||||
$CLICKHOUSE_CLIENT -q "SYSTEM RESTART REPLICA replica_01108_${i}";
|
||||
$CLICKHOUSE_CLIENT -q "SYSTEM RESTART REPLICA replica_01108_${i}_tmp";
|
||||
done
|
||||
sleep 0.$RANDOM;
|
||||
done
|
||||
}
|
||||
function restart_thread_1()
|
||||
{
|
||||
restart_replicas_loop
|
||||
}
|
||||
|
||||
function restart_thread_2()
|
||||
{
|
||||
while true; do
|
||||
$CLICKHOUSE_CLIENT -q "SYSTEM RESTART REPLICAS";
|
||||
sleep 0.$RANDOM;
|
||||
done
|
||||
restart_replicas_loop
|
||||
}
|
||||
|
||||
export -f rename_thread_1;
|
||||
|
@ -17,7 +17,9 @@ ALTER TABLE test_alter_r2 MODIFY COLUMN x DEFAULT '2000-01-01' SETTINGS replicat
|
||||
DESCRIBE TABLE test_alter_r1;
|
||||
DESCRIBE TABLE test_alter_r2;
|
||||
|
||||
SYSTEM RESTART REPLICAS;
|
||||
SYSTEM RESTART REPLICA test_alter_r1;
|
||||
SYSTEM RESTART REPLICA test_alter_r2;
|
||||
|
||||
DESCRIBE TABLE test_alter_r1;
|
||||
DESCRIBE TABLE test_alter_r2;
|
||||
|
||||
|
@ -0,0 +1,2 @@
|
||||
x Date
|
||||
s String
|
@ -0,0 +1,5 @@
|
||||
DROP TABLE IF EXISTS data_01646;
|
||||
CREATE TABLE data_01646 (x Date, s String) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test_01646/data_01646', 'r') ORDER BY s PARTITION BY x;
|
||||
SYSTEM RESTART REPLICAS;
|
||||
DESCRIBE TABLE data_01646;
|
||||
DROP TABLE data_01646;
|
@ -15,7 +15,8 @@
|
||||
"01526_max_untracked_memory", /// requires TraceCollector, does not available under sanitizers
|
||||
"01474_executable_dictionary", /// informational stderr from sanitizer at start
|
||||
"functions_bad_arguments", /// Too long for TSan
|
||||
"01603_read_with_backoff_bug" /// Too long for TSan
|
||||
"01603_read_with_backoff_bug", /// Too long for TSan
|
||||
"01646_system_restart_replicas_smoke" /// RESTART REPLICAS can acquire too much locks, while only 64 is possible from one thread under TSan
|
||||
],
|
||||
"address-sanitizer": [
|
||||
"00877",
|
||||
|
Loading…
Reference in New Issue
Block a user