Merge pull request #73403 from ClickHouse/parj

Fix logical error when reading from single-replica cluster using parallel replicas
This commit is contained in:
Michael Kolupaev 2024-12-18 03:22:17 +00:00 committed by GitHub
commit 2467a49811
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View File

@ -631,7 +631,8 @@ void executeQueryWithParallelReplicas(
std::move(analyzed_read_from_merge_tree), std::move(analyzed_read_from_merge_tree),
local_replica_index.value()); local_replica_index.value());
if (!with_parallel_replicas) /// If there's only one replica or the source is empty, just read locally.
if (!with_parallel_replicas || pools_to_use.size() == 1)
{ {
query_plan = std::move(*local_plan); query_plan = std::move(*local_plan);
return; return;

View File

@ -0,0 +1,2 @@
create table src (y Int8) engine MergeTree order by y as select 1;
select 1 from (select 2 from src) settings enable_parallel_replicas=1, max_parallel_replicas=2, cluster_for_parallel_replicas='test_shard_localhost', parallel_replicas_for_non_replicated_merge_tree=1;