Commit Graph

49 Commits

Author SHA1 Message Date
Robert Schulze
0f6715bd91
Follow-up to PR #37300: semicolon warnings
In PR #37300, Alexej asked why we the compiler does not warn about
unnecessary semicolons, e.g.

  f()
  {
  }; // <-- here

The answer is surprising: In C++98, above syntax was disallowed but by
most compilers accepted it regardless. C++>11 introduced "empty
declarations" which made the syntax legal.

The previous behavior can be restored using flag
-Wc++98-compat-extra-semi. This finds many useless semicolons which were
removed in this change. Unfortunately, there are also false positives
which would require #pragma-s and HAS_* logic (--> check_flags.cmake) to
suppress. In the end, -Wc++98-compat-extra-semi comes with extra effort
for little benefit. Therefore, this change only fixes some semicolons
but does not enable the flag.
2022-05-20 15:06:34 +02:00
avogar
e170a1e6b0 Fix build 2022-05-13 15:57:24 +00:00
avogar
53d0bb46d6 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-external-tables-in-hedged-connections 2022-05-13 14:37:58 +00:00
kssenii
0feda67ec4 Fix progress for insert select 2022-05-10 15:04:08 +02:00
avogar
2313774079 Fix sending external tables data in HedgedConnections with max_parallel_replicas 2022-05-06 17:54:57 +00:00
Kruglov Pavel
8d647eff06
Merge pull request #36749 from Avogar/fix-timeouts
Fix bug in receive timeouts in Hedged requests
2022-05-02 13:16:03 +02:00
avogar
04846a39a1 Better exception messages while socket timeouts 2022-04-29 09:04:24 +00:00
avogar
81f85892eb Fix bug in receive timeouts in Hedged requests 2022-04-28 13:10:27 +00:00
Maksim Kita
b1a956c5f1 clang-tidy check performance-move-const-arg fix 2022-03-02 18:15:27 +00:00
Nikita Mikhaylov
dbf5091016
Parallel reading from replicas (#29279) 2021-12-09 13:39:28 +03:00
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
Dmitry Novik
362bcb2f66 Introduce ProfileEvents packet 2021-10-11 17:29:50 +03:00
Nikolai Kochetov
cfa3fd4b87 Hold context in HedgedConnections to prevent use-after-free on settings. 2021-07-29 13:29:36 +03:00
Nikolai Kochetov
7da5bb3871 Do not start new hedged connection if query was already canceled. 2021-07-26 20:48:38 +03:00
Amos Bird
dbfb699690
Asynchronously drain connections. 2021-07-19 21:53:29 +08:00
Nikolai Kochetov
0d549c197f Fix 01822_async_read_from_socket_crash for hedged connection. 2021-07-16 13:42:22 +03:00
Pavel Kruglov
6f65a72112 Remove socket from epoll before cancelling packet receiver to prevent race 2021-04-01 17:35:00 +03:00
Pavel Kruglov
90afc9ce2f Fix build 2021-03-26 21:25:30 +03:00
Pavel Kruglov
2979feb23f Prevent busy waiting in hedged requests when async_socket_for_remote=0 2021-03-26 18:11:06 +03:00
Kruglov Pavel
055242fe95
Style 2021-03-19 01:38:15 +03:00
Pavel Kruglov
d380454044 Change read_data_timeout from sec to ms, add profile event for hedged requests and better process receiving packets 2021-03-18 20:16:17 +03:00
Pavel Kruglov
dc9dd8ccdc Fix typo 2021-03-03 16:16:17 +03:00
Pavel Kruglov
82a6be44cf Disable changing replica when we have made progress 2021-03-03 01:03:03 +03:00
Pavel Kruglov
4166ae1f45 Restart timeout when we make progress 2021-03-02 15:40:24 +03:00
Pavel Kruglov
1b1f50e324 Update comment 2021-02-27 11:45:32 +03:00
Pavel Kruglov
4d7ba0443f Add checking pending data 2021-02-27 11:40:03 +03:00
Pavel Kruglov
91f6f9227b Small fixes and tests updates 2021-02-26 18:55:58 +03:00
Pavel Kruglov
dd5185c779 Refactor 4.0 2021-02-21 17:03:24 +03:00
Pavel Kruglov
1b78de2142 Use fibers in HedgedRequests 2021-02-17 20:34:52 +03:00
Pavel Kruglov
0e1d67ad9a Add LOG_DEBUG to debug test_distributed_load_balancing 2021-02-16 10:56:45 +03:00
Pavel Kruglov
df09a5cac9 Refactor 3.0 and fix tests 2021-02-15 16:21:36 +03:00
Pavel Kruglov
22b8bc6c99 Refactor 2.0 2021-02-09 05:01:09 +03:00
Pavel Kruglov
df5dc102c4 Don't use 'ReplicaStatePtr &' to prevent use-after-free 2021-02-08 23:58:02 +03:00
Pavel Kruglov
7b45860b06 Style fix 2021-02-08 17:02:11 +03:00
Pavel Kruglov
134a686fa5 Fix 2 2021-02-08 16:16:09 +03:00
Pavel Kruglov
d3ebf59376 Fix 2021-02-08 16:08:15 +03:00
Pavel Kruglov
12b925dd7a Small update 2021-02-08 14:06:45 +03:00
Pavel Kruglov
3d8e05dc94 Fix style 2021-02-07 00:54:29 +03:00
Pavel Kruglov
8ff3dde290 Add sendIgnoredPartUUIDs to HedgedRequests 2021-02-06 18:26:36 +03:00
Pavel Kruglov
794f185442 Fix 2021-02-06 17:23:48 +03:00
Pavel Kruglov
0704d3cf27 Refactor 2021-02-06 03:54:27 +03:00
Pavel Kruglov
60a92e9a99 Fix build, add comments, update tests 2021-02-02 15:14:31 +03:00
Kruglov Pavel
3e3ee19818
Restart tests 2021-02-02 00:10:55 +03:00
Pavel Kruglov
7d9eb966f0 Fix 2021-02-01 20:09:55 +03:00
Pavel Kruglov
d27f5114c5 Add LOG_DEBUG for tests debug 2021-01-29 23:21:11 +03:00
Pavel Kruglov
01a0cb649a Fix build, style, tests 2021-01-29 18:46:28 +03:00
Pavel Kruglov
b3b832cde7 Work with any number of replicas simultaneously, support max_parallel_replicas 2021-01-27 12:33:11 +03:00
Pavel Kruglov
507695cbcb Fix build 2021-01-20 02:15:13 +03:00
Pavel Kruglov
97b5179e55 Implement HedgedRequests 2021-01-19 22:41:05 +03:00