This commit is contained in:
Nikita Taranov 2024-04-16 14:20:46 +01:00
parent 22e164c65d
commit 5b11815bcc
3 changed files with 24 additions and 0 deletions

View File

@ -1791,6 +1791,11 @@ bool ReadFromMergeTree::requestOutputEachPartitionThroughSeparatePort()
if (isQueryWithFinal())
return false;
/// With parallel replicas we have to have only a single instance of `MergeTreeReadPoolParallelReplicas` per replica.
/// With aggregation-by-partitions optimisation we might create a separate pool for each partition.
if (is_parallel_reading_from_replicas)
return false;
const auto & settings = context->getSettingsRef();
const auto partitions_cnt = countPartitions(prepared_parts);

View File

@ -0,0 +1,19 @@
set max_threads = 16;
set use_hedged_requests = 0;
set max_parallel_replicas = 3;
set cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost';
set allow_experimental_parallel_reading_from_replicas = 1;
set parallel_replicas_for_non_replicated_merge_tree = 1;
set allow_aggregate_partitions_independently = 1;
drop table if exists t2;
create table t2(a Int16) engine=MergeTree order by tuple() partition by a % 8 SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi';
system stop merges t2;
insert into t2 select number from numbers_mt(1e6);
insert into t2 select number from numbers_mt(1e6);
select a from t2 group by a format Null;