ClickHouse/src
Azat Khuzhin 83d68246c3 Fix LOGICAL_ERROR on connection draining in case of ECONNRESET
In case of ECONNRESET (Connection reset by peer) the "cancelled" will
not be set, and so drain() will fail with LOGICAL_ERROR:

<details>

    2021.10.16 04:10:55.054771 [ 7635 ] {882164e0-ca26-4955-8759-708ba1f6e85c} <Error> PullingAsyncPipelineExecutor: Code: 210. DB::NetException: Connection reset by peer, while writing to socket (127.0.0.2:9000). (NETWORK_ERROR), Stack trace (when copying this message, always include the lines below):

    ...
    4. ./obj-x86_64-linux-gnu/../src/Common/NetException.h:12: DB::NetException::NetException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x20db5749 in /usr/bin/clickhouse
    5. ./obj-x86_64-linux-gnu/../src/IO/WriteBufferFromPocoSocket.cpp:56: DB::WriteBufferFromPocoSocket::nextImpl() @ 0x211d56bb in /usr/bin/clickhouse
    6. ./obj-x86_64-linux-gnu/../src/IO/WriteBuffer.h:47: DB::WriteBuffer::next() @ 0x14e4c874 in /usr/bin/clickhouse
    7. ./obj-x86_64-linux-gnu/../src/Client/Connection.cpp:560: DB::Connection::sendCancel() @ 0x227c0c22 in /usr/bin/clickhouse
    8. ./obj-x86_64-linux-gnu/../src/Client/HedgedConnections.cpp:242: DB::HedgedConnections::sendCancel() @ 0x227f1b53 in /usr/bin/clickhouse
    ...
    2021.10.16 04:12:35.555530 [ 5575 ] {} <Fatal> : Logical error: 'Cannot drain connections: cancel first.'.

</details>

Found by stress tests on CI [1].

  [1]: https://clickhouse-test-reports.s3.yandex.net/0/d3cb99701d4aaec384fd183168d10e0f650ecc1d/stress_test_(debug).html#fail1
2021-10-23 22:44:32 +03:00
..
Access Fixed tests 2021-10-14 00:33:18 +03:00
AggregateFunctions Non-recursive implementation for TL and its functions 2021-10-03 18:02:04 +02:00
Backups Rename "common" to "base" 2021-10-02 10:13:14 +03:00
Bridge Move some files. 2021-10-16 17:03:50 +03:00
Client Fix LOGICAL_ERROR on connection draining in case of ECONNRESET 2021-10-23 22:44:32 +03:00
Columns Merge pull request #30014 from jinjunzh/master 2021-10-22 14:16:47 +03:00
Common Merge pull request #30451 from kitaisreal/executable-udf-clickhouse-example 2021-10-20 15:33:32 +03:00
Compression better interfaces for IDataType and ISerialization 2021-10-14 05:36:49 +03:00
Coordination Merge branch 'master' into debug_keeper 2021-10-18 10:16:07 +03:00
Core Merge remote-tracking branch 'upstream/master' into HEAD 2021-10-19 16:48:47 +03:00
Databases Merge pull request #30477 from kssenii/postgres-fix-query 2021-10-23 19:07:34 +03:00
DataTypes Merge pull request #30219 from lhuang09287750/master 2021-10-21 09:38:55 +03:00
Dictionaries Merge pull request #30309 from kssenii/fix-file-symlinks 2021-10-20 11:09:51 +03:00
Disks Add error for multiple keys without current_key_id (#29546) 2021-10-05 14:37:54 +03:00
Formats Update obsolete comments. 2021-10-19 12:58:10 +03:00
Functions Merge pull request #30426 from amosbird/jsonextractstring3 2021-10-21 12:29:11 +03:00
Interpreters Merge pull request #30266 from CurtizJ/aggregation-in-order-4 2021-10-23 18:09:17 +03:00
IO Merge pull request #29672 from ClickHouse/clickhouse-obfuscator-2 2021-10-20 23:06:29 +03:00
Parsers Merge pull request #30520 from azat/fix-unary-postfix-rewrite 2021-10-22 11:31:36 +03:00
Processors Merge pull request #30266 from CurtizJ/aggregation-in-order-4 2021-10-23 18:09:17 +03:00
QueryPipeline Update obsolete comments. 2021-10-19 12:58:10 +03:00
Server Merge pull request #30064 from azat/client-print-profile-events 2021-10-19 12:42:09 +03:00
Storages Merge pull request #30477 from kssenii/postgres-fix-query 2021-10-23 19:07:34 +03:00
TableFunctions Update TableFunctionPostgreSQL.cpp 2021-10-22 13:08:38 +03:00
CMakeLists.txt Merge pull request #30014 from jinjunzh/master 2021-10-22 14:16:47 +03:00
NOTICE Remove DataStreams folder. 2021-10-15 23:18:20 +03:00