Skip to content

Commit 59f061c

Browse files
committed
Merge branch 'master' into add_query_progress_to_table_zookeeper
2 parents b2b9706 + c458920 commit 59f061c

File tree

1,044 files changed

+16064
-4844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,044 files changed

+16064
-4844
lines changed

.clang-tidy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ Checks: [
9696
'-modernize-use-default-member-init',
9797
'-modernize-use-emplace',
9898
'-modernize-use-nodiscard',
99-
'-modernize-use-override',
10099
'-modernize-use-trailing-return-type',
101100

102101
'-performance-inefficient-string-concatenation',
@@ -120,7 +119,6 @@ Checks: [
120119
'-readability-named-parameter',
121120
'-readability-redundant-declaration',
122121
'-readability-simplify-boolean-expr',
123-
'-readability-static-accessed-through-instance',
124122
'-readability-suspicious-call-argument',
125123
'-readability-uppercase-literal-suffix',
126124
'-readability-use-anyofallof',

.github/workflows/master.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
clear-repository: true # to ensure correct digests
2424
fetch-depth: 0 # to get version
2525
filter: tree:0
26+
- name: Merge sync PR
27+
run: |
28+
cd "$GITHUB_WORKSPACE/tests/ci"
29+
python3 sync_pr.py --merge || :
2630
- name: Python unit tests
2731
run: |
2832
cd "$GITHUB_WORKSPACE/tests/ci"

.github/workflows/pull_request.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
${{secrets.ROBOT_CLICKHOUSE_SSH_KEY}}
8484
RCSK
8585
FastTest:
86-
needs: [RunConfig, StyleCheck]
86+
needs: [RunConfig, BuildDockers]
8787
if: ${{ !failure() && !cancelled() && contains(fromJson(needs.RunConfig.outputs.data).jobs_data.jobs_to_do, 'Fast test') }}
8888
uses: ./.github/workflows/reusable_test.yml
8989
with:
@@ -158,15 +158,24 @@ jobs:
158158
#
159159
FinishCheck:
160160
if: ${{ !failure() && !cancelled() }}
161-
needs: [Tests_1, Tests_2]
161+
needs: [Tests_1, Tests_2, Builds_1_Report, Builds_2_Report]
162162
runs-on: [self-hosted, style-checker]
163163
steps:
164164
- name: Check out repository code
165165
uses: ClickHouse/checkout@v1
166+
- name: Check sync status
167+
if: ${{ github.event_name == 'merge_group' }}
168+
run: |
169+
cd "$GITHUB_WORKSPACE/tests/ci"
170+
python3 sync_pr.py --status
166171
- name: Finish label
167172
run: |
168173
cd "$GITHUB_WORKSPACE/tests/ci"
169174
python3 finish_check.py
175+
- name: Auto merge if approved
176+
if: ${{ github.event_name != 'merge_group' }}
177+
run: |
178+
cd "$GITHUB_WORKSPACE/tests/ci"
170179
python3 merge_pr.py --check-approved
171180
172181

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
[submodule "contrib/capnproto"]
2323
path = contrib/capnproto
2424
url = https://github.com/ClickHouse/capnproto
25-
[submodule "contrib/double-conversion"]
26-
path = contrib/double-conversion
27-
url = https://github.com/google/double-conversion
2825
[submodule "contrib/re2"]
2926
path = contrib/re2
3027
url = https://github.com/google/re2
@@ -369,3 +366,6 @@
369366
[submodule "contrib/idna"]
370367
path = contrib/idna
371368
url = https://github.com/ada-url/idna.git
369+
[submodule "contrib/double-conversion"]
370+
path = contrib/double-conversion
371+
url = https://github.com/ClickHouse/double-conversion.git

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
* Something was wrong with Apache Hive, which is experimental and not supported. [#60262](https://github.com/ClickHouse/ClickHouse/pull/60262) ([shanfengp](https://github.com/Aed-p)).
124124
* An improvement for experimental parallel replicas: force reanalysis if parallel replicas changed [#60362](https://github.com/ClickHouse/ClickHouse/pull/60362) ([Raúl Marín](https://github.com/Algunenano)).
125125
* Fix usage of plain metadata type with new disks configuration option [#60396](https://github.com/ClickHouse/ClickHouse/pull/60396) ([Kseniia Sumarokova](https://github.com/kssenii)).
126-
* Don't allow to set max_parallel_replicas to 0 as it doesn't make sense [#60430](https://github.com/ClickHouse/ClickHouse/pull/60430) ([Kruglov Pavel](https://github.com/Avogar)).
127126
* Try to fix logical error 'Cannot capture column because it has incompatible type' in mapContainsKeyLike [#60451](https://github.com/ClickHouse/ClickHouse/pull/60451) ([Kruglov Pavel](https://github.com/Avogar)).
128127
* Avoid calculation of scalar subqueries for CREATE TABLE. [#60464](https://github.com/ClickHouse/ClickHouse/pull/60464) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
129128
* Fix deadlock in parallel parsing when lots of rows are skipped due to errors [#60516](https://github.com/ClickHouse/ClickHouse/pull/60516) ([Kruglov Pavel](https://github.com/Avogar)).

base/base/scope_guard.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ class [[nodiscard]] BasicScopeGuard
2929
requires std::is_convertible_v<G, F>
3030
constexpr BasicScopeGuard & operator=(BasicScopeGuard<G> && src) // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved, cppcoreguidelines-noexcept-move-operations)
3131
{
32-
if (this != &src)
32+
if constexpr (std::is_same_v<G, F>)
3333
{
34-
invoke();
35-
function = src.release();
34+
if (this == &src)
35+
return *this;
3636
}
37+
invoke();
38+
function = src.release();
3739
return *this;
3840
}
3941

base/base/wide_integer_impl.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
#include <tuple>
1414
#include <limits>
1515

16-
#include <boost/math/special_functions/fpclassify.hpp>
17-
1816
// NOLINTBEGIN(*)
1917

2018
/// Use same extended double for all platforms
2119
#if (LDBL_MANT_DIG == 64)
2220
#define CONSTEXPR_FROM_DOUBLE constexpr
2321
using FromDoubleIntermediateType = long double;
2422
#else
23+
#include <boost/math/special_functions/fpclassify.hpp>
2524
#include <boost/multiprecision/cpp_bin_float.hpp>
2625
/// `wide_integer_from_builtin` can't be constexpr with non-literal `cpp_bin_float_double_extended`
2726
#define CONSTEXPR_FROM_DOUBLE
@@ -309,6 +308,13 @@ struct integer<Bits, Signed>::_impl
309308
constexpr uint64_t max_int = std::numeric_limits<uint64_t>::max();
310309
static_assert(std::is_same_v<T, double> || std::is_same_v<T, FromDoubleIntermediateType>);
311310
/// Implementation specific behaviour on overflow (if we don't check here, stack overflow will triggered in bigint_cast).
311+
#if (LDBL_MANT_DIG == 64)
312+
if (!std::isfinite(t))
313+
{
314+
self = 0;
315+
return;
316+
}
317+
#else
312318
if constexpr (std::is_same_v<T, double>)
313319
{
314320
if (!std::isfinite(t))
@@ -325,6 +331,7 @@ struct integer<Bits, Signed>::_impl
325331
return;
326332
}
327333
}
334+
#endif
328335

329336
const T alpha = t / static_cast<T>(max_int);
330337

base/poco/Foundation/src/pcre_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4835,7 +4835,7 @@ for (;; ptr++)
48354835
48364836
If the class contains characters outside the 0-255 range, a different
48374837
opcode is compiled. It may optionally have a bit map for characters < 256,
4838-
but those above are are explicitly listed afterwards. A flag byte tells
4838+
but those above are explicitly listed afterwards. A flag byte tells
48394839
whether the bitmap is present, and whether this is a negated class or not.
48404840
48414841
In JavaScript compatibility mode, an isolated ']' causes an error. In

base/poco/JSON/src/pdjson.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,13 @@ static int read_unicode(json_stream *json)
314314

315315
if (l < 0xdc00 || l > 0xdfff) {
316316
json_error(json, "invalid surrogate pair continuation \\u%04lx out "
317-
"of range (dc00-dfff)", l);
317+
"of range (dc00-dfff)", (unsigned long)l);
318318
return -1;
319319
}
320320

321321
cp = ((h - 0xd800) * 0x400) + ((l - 0xdc00) + 0x10000);
322322
} else if (cp >= 0xdc00 && cp <= 0xdfff) {
323-
json_error(json, "dangling surrogate \\u%04lx", cp);
323+
json_error(json, "dangling surrogate \\u%04lx", (unsigned long)cp);
324324
return -1;
325325
}
326326

base/poco/Net/include/Poco/Net/HTTPClientSession.h

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,19 @@ namespace Net
213213
Poco::Timespan getKeepAliveTimeout() const;
214214
/// Returns the connection timeout for HTTP connections.
215215

216+
void setKeepAliveMaxRequests(int max_requests);
217+
218+
int getKeepAliveMaxRequests() const;
219+
220+
int getKeepAliveRequest() const;
221+
222+
bool isKeepAliveExpired(double reliability = 1.0) const;
223+
/// Returns if the connection is expired with some margin as fraction of timeout as reliability
224+
225+
double getKeepAliveReliability() const;
226+
/// Returns the current fraction of keep alive timeout when connection is considered safe to use
227+
/// It helps to avoid situation when a client uses nearly expired connection and receives NoMessageException
228+
216229
virtual std::ostream & sendRequest(HTTPRequest & request);
217230
/// Sends the header for the given HTTP request to
218231
/// the server.
@@ -345,6 +358,8 @@ namespace Net
345358

346359
void assign(HTTPClientSession & session);
347360

361+
void setKeepAliveRequest(int request);
362+
348363
HTTPSessionFactory _proxySessionFactory;
349364
/// Factory to create HTTPClientSession to proxy.
350365
private:
@@ -353,6 +368,8 @@ namespace Net
353368
Poco::UInt16 _port;
354369
ProxyConfig _proxyConfig;
355370
Poco::Timespan _keepAliveTimeout;
371+
int _keepAliveCurrentRequest = 0;
372+
int _keepAliveMaxRequests = 1000;
356373
Poco::Timestamp _lastRequest;
357374
bool _reconnect;
358375
bool _mustReconnect;
@@ -361,6 +378,7 @@ namespace Net
361378
Poco::SharedPtr<std::ostream> _pRequestStream;
362379
Poco::SharedPtr<std::istream> _pResponseStream;
363380

381+
static const double _defaultKeepAliveReliabilityLevel;
364382
static ProxyConfig _globalProxyConfig;
365383

366384
HTTPClientSession(const HTTPClientSession &);
@@ -450,9 +468,19 @@ namespace Net
450468
return _lastRequest;
451469
}
452470

453-
inline void HTTPClientSession::setLastRequest(Poco::Timestamp time)
471+
inline double HTTPClientSession::getKeepAliveReliability() const
472+
{
473+
return _defaultKeepAliveReliabilityLevel;
474+
}
475+
476+
inline int HTTPClientSession::getKeepAliveMaxRequests() const
477+
{
478+
return _keepAliveMaxRequests;
479+
}
480+
481+
inline int HTTPClientSession::getKeepAliveRequest() const
454482
{
455-
_lastRequest = time;
483+
return _keepAliveCurrentRequest;
456484
}
457485

458486
}

0 commit comments

Comments
 (0)