Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/Storages/IStorageCluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ namespace ErrorCodes
extern const int NOT_IMPLEMENTED;
}

namespace ErrorCodes
{
extern const int ALL_CONNECTION_TRIES_FAILED;
}

IStorageCluster::IStorageCluster(
const String & cluster_name_,
const StorageID & table_id_,
Expand Down Expand Up @@ -293,10 +298,10 @@ void ReadFromCluster::initializePipeline(QueryPipelineBuilder & pipeline, const
pipes.emplace_back(std::move(pipe));
}

auto pipe = Pipe::unitePipes(std::move(pipes));
if (pipe.empty())
pipe = Pipe(std::make_shared<NullSource>(getOutputHeader()));
if (pipes.empty())
throw Exception(ErrorCodes::ALL_CONNECTION_TRIES_FAILED, "Cannot connect to any replica for query execution");

auto pipe = Pipe::unitePipes(std::move(pipes));
for (const auto & processor : pipe.getProcessors())
processors.emplace_back(processor);

Expand Down
14 changes: 14 additions & 0 deletions tests/config/config.d/clusters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -325,5 +325,19 @@
</replica>
</shard>
</test_shard_bind_host_fail>
<test_cluster_multiple_nodes_all_unavailable>
<node>
<host>127.0.0.1</host>
<port>1234</port>
</node>
<node>
<host>127.0.0.2</host>
<port>1234</port>
</node>
<node>
<host>127.0.0.3</host>
<port>1234</port>
</node>
</test_cluster_multiple_nodes_all_unavailable>
</remote_servers>
</clickhouse>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Tags: no-fasttest
-- s3Cluster is not used in fast tests

SELECT * FROM s3Cluster('test_cluster_multiple_nodes_all_unavailable', 'http://localhost:11111/test/a.tsv'); -- { serverError ALL_CONNECTION_TRIES_FAILED }
Loading