Don't throw LOGICAL_ERROR when reading from remote if there is no local replica (#49136)

Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
This commit is contained in:
Raúl Marín 2023-04-26 16:22:40 +02:00 committed by GitHub
parent ddfbc61e99
commit 7abb94fe33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,7 +331,7 @@ void ReadFromParallelRemoteReplicasStep::initializePipeline(QueryPipelineBuilder
all_replicas_count = cluster->getShardsInfo().size();
}
/// Find local shard
/// Find local shard. It might happen that there is no local shard, but that's fine
for (const auto & shard: cluster->getShardsInfo())
{
if (shard.isLocal())
@ -346,9 +346,6 @@ void ReadFromParallelRemoteReplicasStep::initializePipeline(QueryPipelineBuilder
}
}
if (pipes.empty())
throw Exception(ErrorCodes::LOGICAL_ERROR, "No local shard");
auto current_shard = cluster->getShardsInfo().begin();
while (pipes.size() != all_replicas_count)
{