This commit is contained in:
Alexey Milovidov 2015-10-16 18:36:43 +03:00
commit 9b15c2e0f1

View File

@ -176,7 +176,6 @@ Cluster::Cluster(const Settings & settings, const String & cluster_name)
replicas.reserve(shard.size()); replicas.reserve(shard.size());
bool has_local_replica = false; bool has_local_replica = false;
bool has_remote_replica = false;
for (const auto & replica : shard) for (const auto & replica : shard)
{ {
@ -184,10 +183,10 @@ Cluster::Cluster(const Settings & settings, const String & cluster_name)
{ {
has_local_replica = true; has_local_replica = true;
local_addresses.push_back(replica); local_addresses.push_back(replica);
break;
} }
else else
{ {
has_remote_replica = true;
replicas.emplace_back(new ConnectionPool( replicas.emplace_back(new ConnectionPool(
settings.distributed_connections_pool_size, settings.distributed_connections_pool_size,
replica.host_name, replica.port, replica.resolved_address, replica.host_name, replica.port, replica.resolved_address,
@ -201,7 +200,7 @@ Cluster::Cluster(const Settings & settings, const String & cluster_name)
if (has_local_replica) if (has_local_replica)
++local_nodes_num; ++local_nodes_num;
if (has_remote_replica) else
pools.emplace_back(new ConnectionPoolWithFailover(replicas, settings.load_balancing, settings.connections_with_failover_max_tries)); pools.emplace_back(new ConnectionPoolWithFailover(replicas, settings.load_balancing, settings.connections_with_failover_max_tries));
} }
} }