Skip to content

Commit cfe8213

Browse files
Merge branch 'ClickHouse:master' into master
2 parents 555df01 + 64e2e10 commit cfe8213

796 files changed

Lines changed: 33708 additions & 113279 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/85_bug-report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Bug report
3-
about: Wrong behaviour (visible to users) in official ClickHouse release.
3+
about: Wrong behavior (visible to users) in the official ClickHouse release.
44
title: ''
55
labels: 'potential bug'
66
assignees: ''

.github/workflows/backport_branches.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,36 @@ jobs:
350350
docker rm -f $(docker ps -a -q) ||:
351351
sudo rm -fr "$TEMP_PATH" "$CACHES_PATH"
352352
############################################################################################
353+
##################################### Docker images #######################################
354+
############################################################################################
355+
DockerServerImages:
356+
needs:
357+
- BuilderDebRelease
358+
- BuilderDebAarch64
359+
runs-on: [self-hosted, style-checker]
360+
steps:
361+
- name: Clear repository
362+
run: |
363+
sudo rm -fr "$GITHUB_WORKSPACE" && mkdir "$GITHUB_WORKSPACE"
364+
- name: Check out repository code
365+
uses: actions/checkout@v2
366+
with:
367+
fetch-depth: 0 # It MUST BE THE SAME for all dependencies and the job itself
368+
- name: Check docker clickhouse/clickhouse-server building
369+
run: |
370+
cd "$GITHUB_WORKSPACE/tests/ci"
371+
python3 docker_server.py --release-type head --no-push
372+
python3 docker_server.py --release-type head --no-push --no-ubuntu \
373+
--image-repo clickhouse/clickhouse-keeper --image-path docker/keeper
374+
- name: Cleanup
375+
if: always()
376+
run: |
377+
# shellcheck disable=SC2046
378+
docker kill $(docker ps -q) ||:
379+
# shellcheck disable=SC2046
380+
docker rm -f $(docker ps -a -q) ||:
381+
sudo rm -fr "$TEMP_PATH"
382+
############################################################################################
353383
##################################### BUILD REPORTER #######################################
354384
############################################################################################
355385
BuilderReport:
@@ -560,6 +590,7 @@ jobs:
560590
FinishCheck:
561591
needs:
562592
- DockerHubPush
593+
- DockerServerImages
563594
- BuilderReport
564595
- FunctionalStatelessTestAsan
565596
- FunctionalStatefulTestDebug

.github/workflows/master.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,7 +2902,7 @@ jobs:
29022902
#############################################################################################
29032903
#################################### PERFORMANCE TESTS ######################################
29042904
#############################################################################################
2905-
PerformanceComparison0:
2905+
PerformanceComparisonX86-0:
29062906
needs: [BuilderDebRelease]
29072907
runs-on: [self-hosted, stress-tester]
29082908
steps:
@@ -2940,7 +2940,7 @@ jobs:
29402940
# shellcheck disable=SC2046
29412941
docker rm -f $(docker ps -a -q) ||:
29422942
sudo rm -fr "$TEMP_PATH"
2943-
PerformanceComparison1:
2943+
PerformanceComparisonX86-1:
29442944
needs: [BuilderDebRelease]
29452945
runs-on: [self-hosted, stress-tester]
29462946
steps:
@@ -2978,7 +2978,7 @@ jobs:
29782978
# shellcheck disable=SC2046
29792979
docker rm -f $(docker ps -a -q) ||:
29802980
sudo rm -fr "$TEMP_PATH"
2981-
PerformanceComparison2:
2981+
PerformanceComparisonX86-2:
29822982
needs: [BuilderDebRelease]
29832983
runs-on: [self-hosted, stress-tester]
29842984
steps:
@@ -3016,7 +3016,7 @@ jobs:
30163016
# shellcheck disable=SC2046
30173017
docker rm -f $(docker ps -a -q) ||:
30183018
sudo rm -fr "$TEMP_PATH"
3019-
PerformanceComparison3:
3019+
PerformanceComparisonX86-3:
30203020
needs: [BuilderDebRelease]
30213021
runs-on: [self-hosted, stress-tester]
30223022
steps:
@@ -3096,10 +3096,10 @@ jobs:
30963096
- IntegrationTestsTsan1
30973097
- IntegrationTestsTsan2
30983098
- IntegrationTestsTsan3
3099-
- PerformanceComparison0
3100-
- PerformanceComparison1
3101-
- PerformanceComparison2
3102-
- PerformanceComparison3
3099+
- PerformanceComparisonX86-0
3100+
- PerformanceComparisonX86-1
3101+
- PerformanceComparisonX86-2
3102+
- PerformanceComparisonX86-3
31033103
- CompatibilityCheck
31043104
- ASTFuzzerTestDebug
31053105
- ASTFuzzerTestAsan

.github/workflows/pull_request.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3118,7 +3118,7 @@ jobs:
31183118
#############################################################################################
31193119
#################################### PERFORMANCE TESTS ######################################
31203120
#############################################################################################
3121-
PerformanceComparison0:
3121+
PerformanceComparisonX86-0:
31223122
needs: [BuilderDebRelease]
31233123
runs-on: [self-hosted, stress-tester]
31243124
steps:
@@ -3156,7 +3156,7 @@ jobs:
31563156
# shellcheck disable=SC2046
31573157
docker rm -f $(docker ps -a -q) ||:
31583158
sudo rm -fr "$TEMP_PATH"
3159-
PerformanceComparison1:
3159+
PerformanceComparisonX86-1:
31603160
needs: [BuilderDebRelease]
31613161
runs-on: [self-hosted, stress-tester]
31623162
steps:
@@ -3194,7 +3194,7 @@ jobs:
31943194
# shellcheck disable=SC2046
31953195
docker rm -f $(docker ps -a -q) ||:
31963196
sudo rm -fr "$TEMP_PATH"
3197-
PerformanceComparison2:
3197+
PerformanceComparisonX86-2:
31983198
needs: [BuilderDebRelease]
31993199
runs-on: [self-hosted, stress-tester]
32003200
steps:
@@ -3232,7 +3232,7 @@ jobs:
32323232
# shellcheck disable=SC2046
32333233
docker rm -f $(docker ps -a -q) ||:
32343234
sudo rm -fr "$TEMP_PATH"
3235-
PerformanceComparison3:
3235+
PerformanceComparisonX86-3:
32363236
needs: [BuilderDebRelease]
32373237
runs-on: [self-hosted, stress-tester]
32383238
steps:
@@ -3270,7 +3270,7 @@ jobs:
32703270
# shellcheck disable=SC2046
32713271
docker rm -f $(docker ps -a -q) ||:
32723272
sudo rm -fr "$TEMP_PATH"
3273-
PerformanceComparisonAarch0:
3273+
PerformanceComparisonAarch-0:
32743274
needs: [BuilderDebAarch64]
32753275
runs-on: [self-hosted, func-tester-aarch64]
32763276
steps:
@@ -3308,7 +3308,7 @@ jobs:
33083308
# shellcheck disable=SC2046
33093309
docker rm -f $(docker ps -a -q) ||:
33103310
sudo rm -fr "$TEMP_PATH"
3311-
PerformanceComparisonAarch1:
3311+
PerformanceComparisonAarch-1:
33123312
needs: [BuilderDebAarch64]
33133313
runs-on: [self-hosted, func-tester-aarch64]
33143314
steps:
@@ -3346,7 +3346,7 @@ jobs:
33463346
# shellcheck disable=SC2046
33473347
docker rm -f $(docker ps -a -q) ||:
33483348
sudo rm -fr "$TEMP_PATH"
3349-
PerformanceComparisonAarch2:
3349+
PerformanceComparisonAarch-2:
33503350
needs: [BuilderDebAarch64]
33513351
runs-on: [self-hosted, func-tester-aarch64]
33523352
steps:
@@ -3384,7 +3384,7 @@ jobs:
33843384
# shellcheck disable=SC2046
33853385
docker rm -f $(docker ps -a -q) ||:
33863386
sudo rm -fr "$TEMP_PATH"
3387-
PerformanceComparisonAarch3:
3387+
PerformanceComparisonAarch-3:
33883388
needs: [BuilderDebAarch64]
33893389
runs-on: [self-hosted, func-tester-aarch64]
33903390
steps:
@@ -3481,14 +3481,14 @@ jobs:
34813481
- IntegrationTestsTsan1
34823482
- IntegrationTestsTsan2
34833483
- IntegrationTestsTsan3
3484-
- PerformanceComparison0
3485-
- PerformanceComparison1
3486-
- PerformanceComparison2
3487-
- PerformanceComparison3
3488-
- PerformanceComparisonAarch0
3489-
- PerformanceComparisonAarch1
3490-
- PerformanceComparisonAarch2
3491-
- PerformanceComparisonAarch3
3484+
- PerformanceComparisonX86-0
3485+
- PerformanceComparisonX86-1
3486+
- PerformanceComparisonX86-2
3487+
- PerformanceComparisonX86-3
3488+
- PerformanceComparisonAarch-0
3489+
- PerformanceComparisonAarch-1
3490+
- PerformanceComparisonAarch-2
3491+
- PerformanceComparisonAarch-3
34923492
- UnitTestsAsan
34933493
- UnitTestsTsan
34943494
- UnitTestsMsan

.github/workflows/release_branches.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,36 @@ jobs:
427427
docker rm -f $(docker ps -a -q) ||:
428428
sudo rm -fr "$TEMP_PATH" "$CACHES_PATH"
429429
############################################################################################
430+
##################################### Docker images #######################################
431+
############################################################################################
432+
DockerServerImages:
433+
needs:
434+
- BuilderDebRelease
435+
- BuilderDebAarch64
436+
runs-on: [self-hosted, style-checker]
437+
steps:
438+
- name: Clear repository
439+
run: |
440+
sudo rm -fr "$GITHUB_WORKSPACE" && mkdir "$GITHUB_WORKSPACE"
441+
- name: Check out repository code
442+
uses: actions/checkout@v2
443+
with:
444+
fetch-depth: 0 # It MUST BE THE SAME for all dependencies and the job itself
445+
- name: Check docker clickhouse/clickhouse-server building
446+
run: |
447+
cd "$GITHUB_WORKSPACE/tests/ci"
448+
python3 docker_server.py --release-type head --no-push
449+
python3 docker_server.py --release-type head --no-push --no-ubuntu \
450+
--image-repo clickhouse/clickhouse-keeper --image-path docker/keeper
451+
- name: Cleanup
452+
if: always()
453+
run: |
454+
# shellcheck disable=SC2046
455+
docker kill $(docker ps -q) ||:
456+
# shellcheck disable=SC2046
457+
docker rm -f $(docker ps -a -q) ||:
458+
sudo rm -fr "$TEMP_PATH"
459+
############################################################################################
430460
##################################### BUILD REPORTER #######################################
431461
############################################################################################
432462
BuilderReport:
@@ -1815,6 +1845,7 @@ jobs:
18151845
FinishCheck:
18161846
needs:
18171847
- DockerHubPush
1848+
- DockerServerImages
18181849
- BuilderReport
18191850
- FunctionalStatelessTestDebug0
18201851
- FunctionalStatelessTestDebug1

CMakeLists.txt

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,13 @@ message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
7474
string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
7575

7676
option(USE_STATIC_LIBRARIES "Disable to use shared libraries" ON)
77+
# DEVELOPER ONLY.
78+
# Faster linking if turned on.
79+
option(SPLIT_SHARED_LIBRARIES "Keep all internal libraries as separate .so files" OFF)
80+
option(CLICKHOUSE_SPLIT_BINARY "Make several binaries (clickhouse-server, clickhouse-client etc.) instead of one bundled" OFF)
7781

78-
if (NOT USE_STATIC_LIBRARIES)
79-
# DEVELOPER ONLY.
80-
# Faster linking if turned on.
81-
option(SPLIT_SHARED_LIBRARIES "Keep all internal libraries as separate .so files")
82-
83-
option(CLICKHOUSE_SPLIT_BINARY
84-
"Make several binaries (clickhouse-server, clickhouse-client etc.) instead of one bundled")
85-
endif ()
86-
87-
if (USE_STATIC_LIBRARIES AND SPLIT_SHARED_LIBRARIES)
88-
message(FATAL_ERROR "Defining SPLIT_SHARED_LIBRARIES=1 without USE_STATIC_LIBRARIES=0 has no effect.")
82+
if (USE_STATIC_LIBRARIES AND (SPLIT_SHARED_LIBRARIES OR CLICKHOUSE_SPLIT_BINARY))
83+
message(FATAL_ERROR "SPLIT_SHARED_LIBRARIES=1 or CLICKHOUSE_SPLIT_BINARY=1 must not be used together with USE_STATIC_LIBRARIES=1")
8984
endif()
9085

9186
if (NOT USE_STATIC_LIBRARIES AND SPLIT_SHARED_LIBRARIES)
@@ -335,6 +330,22 @@ if (COMPILER_GCC OR COMPILER_CLANG)
335330
set(COMPILER_FLAGS "${COMPILER_FLAGS} -falign-functions=32")
336331
endif ()
337332

333+
if (ARCH_AMD64)
334+
# align branches within a 32-Byte boundary to avoid the potential performance loss when code layout change,
335+
# which makes benchmark results more stable.
336+
set(BRANCHES_WITHIN_32B_BOUNDARIES "-mbranches-within-32B-boundaries")
337+
if (COMPILER_GCC)
338+
# gcc is in assembler, need to add "-Wa," prefix
339+
set(BRANCHES_WITHIN_32B_BOUNDARIES "-Wa,${BRANCHES_WITHIN_32B_BOUNDARIES}")
340+
endif()
341+
342+
include(CheckCXXCompilerFlag)
343+
check_cxx_compiler_flag("${BRANCHES_WITHIN_32B_BOUNDARIES}" HAS_BRANCHES_WITHIN_32B_BOUNDARIES)
344+
if (HAS_BRANCHES_WITHIN_32B_BOUNDARIES)
345+
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${BRANCHES_WITHIN_32B_BOUNDARIES}")
346+
endif()
347+
endif()
348+
338349
if (COMPILER_GCC)
339350
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")
340351
endif ()
@@ -507,14 +518,14 @@ if (NOT ENABLE_JEMALLOC)
507518
message (WARNING "Non default allocator is disabled. This is not recommended for production builds.")
508519
endif ()
509520

510-
macro (add_executable target)
521+
macro (clickhouse_add_executable target)
511522
# invoke built-in add_executable
512523
# explicitly acquire and interpose malloc symbols by clickhouse_malloc
513524
# if GLIBC_COMPATIBILITY is ON and ENABLE_THINLTO is on than provide memcpy symbol explicitly to neutrialize thinlto's libcall generation.
514525
if (ARCH_AMD64 AND GLIBC_COMPATIBILITY AND ENABLE_THINLTO)
515-
_add_executable (${ARGV} $<TARGET_OBJECTS:clickhouse_malloc> $<TARGET_OBJECTS:memcpy>)
526+
add_executable (${ARGV} $<TARGET_OBJECTS:clickhouse_malloc> $<TARGET_OBJECTS:memcpy>)
516527
else ()
517-
_add_executable (${ARGV} $<TARGET_OBJECTS:clickhouse_malloc>)
528+
add_executable (${ARGV} $<TARGET_OBJECTS:clickhouse_malloc>)
518529
endif ()
519530

520531
get_target_property (type ${target} TYPE)

base/base/JSON.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
#define JSON_MAX_DEPTH 100
1313

1414

15+
#ifdef __clang__
16+
# pragma clang diagnostic push
17+
# pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
18+
#endif
1519
POCO_IMPLEMENT_EXCEPTION(JSONException, Poco::Exception, "JSONException") // NOLINT(cert-err60-cpp, modernize-use-noexcept, hicpp-use-noexcept)
20+
#ifdef __clang__
21+
# pragma clang diagnostic pop
22+
#endif
1623

1724

1825
/// Прочитать беззнаковое целое в простом формате из не-0-terminated строки.

base/base/JSON.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,14 @@
3838
*/
3939

4040

41+
#ifdef __clang__
42+
# pragma clang diagnostic push
43+
# pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
44+
#endif
4145
POCO_DECLARE_EXCEPTION(Foundation_API, JSONException, Poco::Exception)
42-
46+
#ifdef __clang__
47+
# pragma clang diagnostic pop
48+
#endif
4349

4450
class JSON
4551
{

base/base/defines.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@
100100
# define ALWAYS_INLINE_NO_SANITIZE_UNDEFINED ALWAYS_INLINE
101101
#endif
102102

103+
#if defined(__clang__) && defined(__clang_major__) && __clang_major__ >= 14
104+
# define DISABLE_SANITIZER_INSTRUMENTATION __attribute__((disable_sanitizer_instrumentation))
105+
#else
106+
# define DISABLE_SANITIZER_INSTRUMENTATION
107+
#endif
108+
109+
103110
#if !__has_include(<sanitizer/asan_interface.h>) || !defined(ADDRESS_SANITIZER)
104111
# define ASAN_UNPOISON_MEMORY_REGION(a, b)
105112
# define ASAN_POISON_MEMORY_REGION(a, b)

base/base/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
add_executable (dump_variable dump_variable.cpp)
1+
clickhouse_add_executable (dump_variable dump_variable.cpp)
22
target_link_libraries (dump_variable PRIVATE clickhouse_common_io)

0 commit comments

Comments
 (0)