From bc6fe4f28c4a991c05bf87610f3350c7a5512e75 Mon Sep 17 00:00:00 2001 From: Pavel Kruglov Date: Wed, 17 Feb 2021 20:44:11 +0300 Subject: [PATCH] Minor fixes --- src/Client/Connection.cpp | 16 ++++++++++------ src/Client/Connection.h | 1 + src/Client/ConnectionPoolWithFailover.h | 1 - .../test_distributed_load_balancing/test.py | 4 ---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Client/Connection.cpp b/src/Client/Connection.cpp index d30a6555da5..b6903ae6c92 100644 --- a/src/Client/Connection.cpp +++ b/src/Client/Connection.cpp @@ -66,10 +66,10 @@ void Connection::connect(const ConnectionTimeouts & timeouts) disconnect(); LOG_TRACE(log_wrapper.get(), "Connecting. Database: {}. User: {}{}{}", - default_database.empty() ? "(not specified)" : default_database, - user, - static_cast(secure) ? ". Secure" : "", - static_cast(compression) ? "" : ". Uncompressed"); + default_database.empty() ? "(not specified)" : default_database, + user, + static_cast(secure) ? ". Secure" : "", + static_cast(compression) ? "" : ". Uncompressed"); if (static_cast(secure)) { @@ -103,7 +103,7 @@ void Connection::connect(const ConnectionTimeouts & timeouts) #if defined(TCP_KEEPALIVE) TCP_KEEPALIVE #else - TCP_KEEPIDLE // __APPLE__ + TCP_KEEPIDLE // __APPLE__ #endif , timeouts.tcp_keep_alive_timeout); } @@ -120,7 +120,7 @@ void Connection::connect(const ConnectionTimeouts & timeouts) receiveHello(); LOG_TRACE(log_wrapper.get(), "Connected to {} server version {}.{}.{}.", - server_name, server_version_major, server_version_minor, server_version_patch); + server_name, server_version_major, server_version_minor, server_version_patch); } catch (Poco::Net::NetException & e) { @@ -151,6 +151,7 @@ void Connection::disconnect() connected = false; } + void Connection::sendHello() { /** Disallow control characters in user controlled parameters @@ -206,6 +207,7 @@ void Connection::sendHello() out->next(); } + void Connection::receiveHello() { /// Receive hello packet. @@ -337,6 +339,8 @@ void Connection::sendClusterNameAndSalt() bool Connection::ping() { + // LOG_TRACE(log_wrapper.get(), "Ping"); + TimeoutSetter timeout_setter(*socket, sync_request_timeout, true); try { diff --git a/src/Client/Connection.h b/src/Client/Connection.h index dd501b5f6ef..d317ecb56b3 100644 --- a/src/Client/Connection.h +++ b/src/Client/Connection.h @@ -196,6 +196,7 @@ public: Poco::Net::Socket * getSocket() { return socket.get(); } + /// Each time read from socket blocks and async_callback is set, it will be called. You can poll socket inside it. void setAsyncCallback(AsyncCallback async_callback_) { async_callback = std::move(async_callback_); diff --git a/src/Client/ConnectionPoolWithFailover.h b/src/Client/ConnectionPoolWithFailover.h index 2ecb0492747..023ef863bdf 100644 --- a/src/Client/ConnectionPoolWithFailover.h +++ b/src/Client/ConnectionPoolWithFailover.h @@ -31,7 +31,6 @@ enum class PoolMode GET_ALL }; - class ConnectionPoolWithFailover : public IConnectionPool, private PoolWithFailoverBase { public: diff --git a/tests/integration/test_distributed_load_balancing/test.py b/tests/integration/test_distributed_load_balancing/test.py index c7fd6d9ab26..d3ac5c132cd 100644 --- a/tests/integration/test_distributed_load_balancing/test.py +++ b/tests/integration/test_distributed_load_balancing/test.py @@ -166,11 +166,7 @@ def test_load_balancing_priority_round_robin(dist_table): def test_distributed_replica_max_ignored_errors(): settings = { -<<<<<<< Updated upstream 'use_hedged_requests' : 0, -======= - 'use_hedged_requests': 0, ->>>>>>> Stashed changes 'load_balancing': 'in_order', 'prefer_localhost_replica': 0, 'connect_timeout': 2,