mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
Fix style
This commit is contained in:
parent
7d9eb966f0
commit
f5ad1281f7
@ -92,8 +92,8 @@ void Connection::connect(const ConnectionTimeouts & timeouts)
|
||||
|
||||
void Connection::disconnect()
|
||||
{
|
||||
LOG_DEBUG(log_wrapper.get(), "disconnect");
|
||||
|
||||
LOG_DEBUG(log_wrapper.get(), "disconnect");
|
||||
|
||||
maybe_compressed_out = nullptr;
|
||||
in = nullptr;
|
||||
last_input_packet_type.reset();
|
||||
|
@ -426,7 +426,8 @@ void GetHedgedConnections::setBestUsableReplica(ReplicaStatePtr & replica)
|
||||
std::remove_if(
|
||||
indexes.begin(),
|
||||
indexes.end(),
|
||||
[&](int i) {
|
||||
[&](int i)
|
||||
{
|
||||
return try_get_connections[i].result.entry.isNull() || !try_get_connections[i].result.is_usable ||
|
||||
indexes_in_process.find(i) != indexes_in_process.end() || ready_indexes.find(i) != ready_indexes.end();
|
||||
}),
|
||||
@ -439,9 +440,13 @@ void GetHedgedConnections::setBestUsableReplica(ReplicaStatePtr & replica)
|
||||
}
|
||||
|
||||
/// Sort replicas by staleness
|
||||
std::stable_sort(indexes.begin(), indexes.end(), [&](size_t lhs, size_t rhs) {
|
||||
return try_get_connections[lhs].result.staleness < try_get_connections[rhs].result.staleness;
|
||||
});
|
||||
std::stable_sort(
|
||||
indexes.begin(),
|
||||
indexes.end(),
|
||||
[&](size_t lhs, size_t rhs)
|
||||
{
|
||||
return try_get_connections[lhs].result.staleness < try_get_connections[rhs].result.staleness;
|
||||
});
|
||||
|
||||
replica->index = indexes[0];
|
||||
replica->connection = &*try_get_connections[indexes[0]].result.entry;
|
||||
|
Loading…
Reference in New Issue
Block a user