Skip to content

Commit 1e52926

Browse files
authored
Merge branch 'master' into Follow_up_Backup_Restore_concurrency_check_node_2
2 parents 9a2645a + 15ebbd2 commit 1e52926

File tree

665 files changed

+13936
-5049
lines changed

Some content is hidden

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

665 files changed

+13936
-5049
lines changed

.clang-tidy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Checks: '*,
2323
-bugprone-implicit-widening-of-multiplication-result,
2424
-bugprone-narrowing-conversions,
2525
-bugprone-not-null-terminated-result,
26-
-bugprone-reserved-identifier,
26+
-bugprone-reserved-identifier, # useful but too slow, TODO retry when https://reviews.llvm.org/rG1c282052624f9d0bd273bde0b47b30c96699c6c7 is merged
2727
-bugprone-unchecked-optional-access,
2828
2929
-cert-dcl16-c,
@@ -111,6 +111,7 @@ Checks: '*,
111111
-misc-no-recursion,
112112
-misc-non-private-member-variables-in-classes,
113113
-misc-confusable-identifiers, # useful but slooow
114+
-misc-use-anonymous-namespace,
114115
115116
-modernize-avoid-c-arrays,
116117
-modernize-concat-nested-namespaces,
@@ -136,7 +137,7 @@ Checks: '*,
136137
-readability-function-cognitive-complexity,
137138
-readability-function-size,
138139
-readability-identifier-length,
139-
-readability-identifier-naming,
140+
-readability-identifier-naming, # useful but too slow
140141
-readability-implicit-bool-conversion,
141142
-readability-isolate-declaration,
142143
-readability-magic-numbers,
@@ -148,7 +149,7 @@ Checks: '*,
148149
-readability-uppercase-literal-suffix,
149150
-readability-use-anyofallof,
150151
151-
-zirkon-*,
152+
-zircon-*,
152153
'
153154

154155
WarningsAsErrors: '*'
@@ -168,11 +169,10 @@ CheckOptions:
168169
readability-identifier-naming.ParameterPackCase: lower_case
169170
readability-identifier-naming.StructCase: CamelCase
170171
readability-identifier-naming.TemplateTemplateParameterCase: CamelCase
171-
readability-identifier-naming.TemplateUsingCase: lower_case
172+
readability-identifier-naming.TemplateParameterCase: lower_case
172173
readability-identifier-naming.TypeTemplateParameterCase: CamelCase
173174
readability-identifier-naming.TypedefCase: CamelCase
174175
readability-identifier-naming.UnionCase: CamelCase
175-
readability-identifier-naming.UsingCase: CamelCase
176176
modernize-loop-convert.UseCxx20ReverseRanges: false
177177
performance-move-const-arg.CheckTriviallyCopyableMove: false
178178
# Workaround clang-tidy bug: https://github.com/llvm/llvm-project/issues/46097

.clangd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Diagnostics:
2+
# clangd does parse .clang-tidy, but some checks are too slow to run in
3+
# clang-tidy build, so let's enable them explicitly for clangd at least.
4+
ClangTidy:
5+
# The following checks had been disabled due to slowliness with C++23,
6+
# for more details see [1].
7+
#
8+
# [1]: https://github.com/llvm/llvm-project/issues/61418
9+
#
10+
# But the code base had been written in a style that had been checked
11+
# by this check, so at least, let's enable it for clangd.
12+
Add: [
13+
# configured in .clang-tidy
14+
readability-identifier-naming,
15+
bugprone-reserved-identifier,
16+
]

.github/workflows/master.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,40 @@ jobs:
13411341
docker ps --quiet | xargs --no-run-if-empty docker kill ||:
13421342
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
13431343
sudo rm -fr "$TEMP_PATH"
1344+
FunctionalStatelessTestReleaseAnalyzer:
1345+
needs: [BuilderDebRelease]
1346+
runs-on: [self-hosted, func-tester]
1347+
steps:
1348+
- name: Set envs
1349+
run: |
1350+
cat >> "$GITHUB_ENV" << 'EOF'
1351+
TEMP_PATH=${{runner.temp}}/stateless_analyzer
1352+
REPORTS_PATH=${{runner.temp}}/reports_dir
1353+
CHECK_NAME=Stateless tests (release, analyzer)
1354+
REPO_COPY=${{runner.temp}}/stateless_analyzer/ClickHouse
1355+
KILL_TIMEOUT=10800
1356+
EOF
1357+
- name: Download json reports
1358+
uses: actions/download-artifact@v3
1359+
with:
1360+
path: ${{ env.REPORTS_PATH }}
1361+
- name: Check out repository code
1362+
uses: ClickHouse/checkout@v1
1363+
with:
1364+
clear-repository: true
1365+
- name: Functional test
1366+
run: |
1367+
sudo rm -fr "$TEMP_PATH"
1368+
mkdir -p "$TEMP_PATH"
1369+
cp -r "$GITHUB_WORKSPACE" "$TEMP_PATH"
1370+
cd "$REPO_COPY/tests/ci"
1371+
python3 functional_test_check.py "$CHECK_NAME" "$KILL_TIMEOUT"
1372+
- name: Cleanup
1373+
if: always()
1374+
run: |
1375+
docker ps --quiet | xargs --no-run-if-empty docker kill ||:
1376+
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
1377+
sudo rm -fr "$TEMP_PATH"
13441378
FunctionalStatelessTestAarch64:
13451379
needs: [BuilderDebAarch64]
13461380
runs-on: [self-hosted, func-tester-aarch64]

.github/workflows/nightly.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ jobs:
7272
with:
7373
name: changed_images
7474
path: ${{ runner.temp }}/changed_images.json
75+
Codebrowser:
76+
needs: [DockerHubPush]
77+
uses: ./.github/workflows/woboq.yml
7578
BuilderCoverity:
7679
needs: DockerHubPush
7780
runs-on: [self-hosted, builder]
@@ -125,8 +128,8 @@ jobs:
125128
SONAR_SCANNER_VERSION: 4.8.0.2856
126129
SONAR_SERVER_URL: "https://sonarcloud.io"
127130
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
128-
CC: clang-15
129-
CXX: clang++-15
131+
CC: clang-16
132+
CXX: clang++-16
130133
steps:
131134
- name: Check out repository code
132135
uses: ClickHouse/checkout@v1

.github/workflows/woboq.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ env:
66
concurrency:
77
group: woboq
88
on: # yamllint disable-line rule:truthy
9-
schedule:
10-
- cron: '0 */18 * * *'
119
workflow_dispatch:
10+
workflow_call:
1211
jobs:
1312
# don't use dockerhub push because this image updates so rarely
1413
WoboqCodebrowser:
@@ -26,6 +25,10 @@ jobs:
2625
with:
2726
clear-repository: true
2827
submodules: 'true'
28+
- name: Download json reports
29+
uses: actions/download-artifact@v3
30+
with:
31+
path: ${{ env.IMAGES_PATH }}
2932
- name: Codebrowser
3033
run: |
3134
sudo rm -fr "$TEMP_PATH"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ website/package-lock.json
129129
/.ccls-cache
130130

131131
# clangd cache
132-
/.clangd
133132
/.cache
134133

135134
/compile_commands.json

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
url = https://github.com/ClickHouse/nats.c
268268
[submodule "contrib/vectorscan"]
269269
path = contrib/vectorscan
270-
url = https://github.com/VectorCamp/vectorscan
270+
url = https://github.com/ClickHouse/vectorscan.git
271271
[submodule "contrib/c-ares"]
272272
path = contrib/c-ares
273273
url = https://github.com/ClickHouse/c-ares
@@ -338,6 +338,9 @@
338338
[submodule "contrib/liburing"]
339339
path = contrib/liburing
340340
url = https://github.com/axboe/liburing
341+
[submodule "contrib/libfiu"]
342+
path = contrib/libfiu
343+
url = https://github.com/ClickHouse/libfiu.git
341344
[submodule "contrib/isa-l"]
342345
path = contrib/isa-l
343346
url = https://github.com/ClickHouse/isa-l.git

CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,6 @@ if (COMPILER_CLANG)
342342

343343
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstrict-vtable-pointers")
344344

345-
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
346-
# Set new experimental pass manager, it's a performance, build time and binary size win.
347-
# Can be removed after https://reviews.llvm.org/D66490 merged and released to at least two versions of clang.
348-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-new-pass-manager")
349-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexperimental-new-pass-manager")
350-
endif ()
351-
352345
# We cannot afford to use LTO when compiling unit tests, and it's not enough
353346
# to only supply -fno-lto at the final linking stage. So we disable it
354347
# completely.
@@ -395,6 +388,8 @@ if ((NOT OS_LINUX AND NOT OS_ANDROID) OR (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG"))
395388
set(ENABLE_GWP_ASAN OFF)
396389
endif ()
397390

391+
option (ENABLE_FIU "Enable Fiu" ON)
392+
398393
option(WERROR "Enable -Werror compiler option" ON)
399394

400395
if (WERROR)

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,26 @@ curl https://clickhouse.com/ | sh
2121
* [Contacts](https://clickhouse.com/company/contact) can help to get your questions answered if there are any.
2222

2323
## Upcoming Events
24-
* [**ClickHouse Spring Meetup in Manhattan**](https://www.meetup.com/clickhouse-new-york-user-group/events/292517734) - April 26 - It's spring, and it's time to meet again in the city! Talks include: "Building a domain specific query language on top of Clickhouse", "A Galaxy of Information", "Our Journey to ClickHouse Cloud from Redshift", and a ClickHouse update!
25-
* [**v23.4 Release Webinar**](https://clickhouse.com/company/events/v23-4-release-webinar?utm_source=github&utm_medium=social&utm_campaign=release-webinar-2023-04) - April 26 - 23.4 is rapidly approaching. Original creator, co-founder, and CTO of ClickHouse Alexey Milovidov will walk us through the highlights of the release.
26-
* [**ClickHouse Meetup in Berlin**](https://www.meetup.com/clickhouse-berlin-user-group/events/292892466) - May 16 - Save the date! ClickHouse is coming back to Berlin. We’re excited to announce an upcoming ClickHouse Meetup that you won’t want to miss. Join us as we gather together to discuss the latest in the world of ClickHouse and share user stories.
24+
25+
* [**v23.5 Release Webinar**](https://clickhouse.com/company/events/v23-5-release-webinar?utm_source=github&utm_medium=social&utm_campaign=release-webinar-2023-05) - May 31 - 23.5 is rapidly approaching. Original creator, co-founder, and CTO of ClickHouse Alexey Milovidov will walk us through the highlights of the release.
26+
* [**ClickHouse Meetup in Berlin**](https://www.meetup.com/clickhouse-berlin-user-group/events/292892466) - May 16
27+
* [**ClickHouse Meetup in Barcelona**](https://www.meetup.com/clickhouse-barcelona-user-group/events/292892669) - May 25
28+
* [**ClickHouse Meetup in London**](https://www.meetup.com/clickhouse-london-user-group/events/292892824) - May 25
29+
* [**ClickHouse Meetup in San Francisco**](https://www.meetup.com/clickhouse-silicon-valley-meetup-group/events/293426725/) - Jun 7
30+
* [**ClickHouse Meetup in Stockholm**](https://www.meetup.com/clickhouse-berlin-user-group/events/292892466) - Jun 13
31+
32+
Also, keep an eye out for upcoming meetups in Amsterdam, Boston, NYC, Beijing, and Toronto. Somewhere else you want us to be? Please feel free to reach out to tyler <at> clickhouse <dot> com.
2733

2834
## Recent Recordings
2935
* **Recent Meetup Videos**: [Meetup Playlist](https://www.youtube.com/playlist?list=PL0Z2YDlm0b3iNDUzpY1S3L_iV4nARda_U) Whenever possible recordings of the ClickHouse Community Meetups are edited and presented as individual talks. Current featuring "Modern SQL in 2023", "Fast, Concurrent, and Consistent Asynchronous INSERTS in ClickHouse", and "Full-Text Indices: Design and Experiments"
30-
* **Recording available**: [**v23.3 Release Webinar**](https://www.youtube.com/watch?v=ISaGUjvBNao) UNDROP TABLE, server settings introspection, nested dynamic disks, MySQL compatibility, parseDate Time, Lightweight Deletes, Parallel Replicas, integrations updates, and so much more! Watch it now!
36+
* **Recording available**: [**v23.4 Release Webinar**](https://www.youtube.com/watch?v=4rrf6bk_mOg) Faster Parquet Reading, Asynchonous Connections to Reoplicas, Trailing Comma before FROM, extractKeyValuePairs, integrations updates, and so much more! Watch it now!
3137
* **All release webinar recordings**: [YouTube playlist](https://www.youtube.com/playlist?list=PL0Z2YDlm0b3jAlSy1JxyP8zluvXaN3nxU)
38+
39+
40+
## Interested in joining ClickHouse and making it your full time job?
41+
42+
We are a globally diverse and distributed team, united behind a common goal of creating industry-leading, real-time analytics. Here, you will have an opportunity to solve some of the most cutting edge technical challenges and have direct ownership of your work and vision. If you are a contributor by nature, a thinker as well as a doer - we’ll definitely click!
43+
44+
Check out our **current openings** here: https://clickhouse.com/company/careers
45+
46+
Cant find what you are looking for, but want to let us know you are interested in joining ClickHouse? Email [email protected]!

base/base/wide_integer_impl.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,14 @@ struct integer<Bits, Signed>::_impl
314314

315315
const T alpha = t / static_cast<T>(max_int);
316316

317-
if (alpha <= static_cast<T>(max_int))
317+
/** Here we have to use strict comparison.
318+
* The max_int is 2^64 - 1.
319+
* When casted to floating point type, it will be rounded to the closest representable number,
320+
* which is 2^64.
321+
* But 2^64 is not representable in uint64_t,
322+
* so the maximum representable number will be strictly less.
323+
*/
324+
if (alpha < static_cast<T>(max_int))
318325
self = static_cast<uint64_t>(alpha);
319326
else // max(double) / 2^64 will surely contain less than 52 precision bits, so speed up computations.
320327
set_multiplier<double>(self, static_cast<double>(alpha));

0 commit comments

Comments
 (0)