Fix 02982_parallel_replicas_unexpected_cluster

This commit is contained in:
Igor Nikonov 2024-07-16 21:05:27 +00:00
parent 5347754aed
commit fc693cc982

View File

@ -736,6 +736,12 @@ bool canUseParallelReplicasOnInitiator(const ContextPtr & context)
return cluster->getShardsInfo().at(shard_num - 1).getAllNodeCount() > 1; return cluster->getShardsInfo().at(shard_num - 1).getAllNodeCount() > 1;
} }
if (cluster->getShardCount() > 1)
throw DB::Exception(
ErrorCodes::UNEXPECTED_CLUSTER,
"`cluster_for_parallel_replicas` setting refers to cluster with {} shards. Expected a cluster with one shard",
cluster->getShardCount());
return false; return false;
} }