v.23.4Improvement
Add Async Socket Connection and Writing with Fiber Refactor
Add async connection to socket and async writing to socket. Make creating connections and sending query/external tables async across shards. Refactor code with fibers. Closes #46931. We will be able to increase connect_timeout_with_failover_ms by default after this PR (https://github.com/ClickHouse/ClickHouse/issues/5188). #47229 (Kruglov Pavel).Why it matters
This feature addresses the inefficiencies in synchronous connection handling and query sending across shards by enabling asynchronous operations. It reduces latency and improves resource utilization during distributed query execution. Additionally, it lays the groundwork for safely increasing the defaultconnect_timeout_with_failover_ms value, enhancing connection reliability.How to use it
The asynchronous connection and socket writing behavior is integrated internally; users benefit automatically when running distributed queries involving shards. To take full advantage, ensure your ClickHouse version includes this update. No explicit user configuration is required to enable async connections, but monitoring and adjustingconnect_timeout_with_failover_ms after upgrade is recommended.