Commit Graph
1818 Commits
Author SHA1 Message Date
Alexey MilovidovandGitHub 842b133f8d Merge pull request #100399 from ClickHouse/clang-tidy-init-variables
Enable clang-tidy check for uninitialized variables
2026-05-31 21:56:29 -07:00
Alexey Milovidov 1e4a7a281f Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables 2026-05-30 05:15:32 +00:00
Alexey Milovidov ab6cd89b58 Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp
#	src/Client/BuzzHouse/AST/SQLProtoStr.cpp
#	src/Functions/UserDefined/UserDefinedWebAssembly.cpp
#	src/IO/examples/parse_int_perf.cpp
#	src/Processors/QueryPlan/Optimizations/removeUnusedColumns.cpp
#	src/TableFunctions/TableFunctionMergeTreeAnalyzeIndexes.cpp
2026-05-29 02:17:22 +00:00
Nikita TaranovandGitHub bd6d798801 Merge pull request #100242 from ClickHouse/enable_query_profiler_under_sanitizers
Enable query profiler under sanitizers
2026-05-28 13:29:19 +00:00
Alexey Milovidov d5538f7d5d Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables
# Conflicts:
#	src/Compression/CompressionCodecALP.cpp
#	src/Functions/UserDefined/UserDefinedWebAssembly.cpp
#	src/IO/AzureBlobStorage/copyAzureBlobStorageFile.cpp
#	src/Interpreters/WasmModuleManager.h
#	src/Parsers/CreateQueryUUIDs.cpp
#	src/Storages/StorageTimeSeries.h
#	src/Storages/TimeSeries/PrometheusRemoteWriteProtocol.cpp
2026-05-27 22:00:22 +00:00
Azat KhuzhinandGitHub cf3ab8d0f5 Merge pull request #105265 from azat/memory-tracker-min-alloc-throw-size
RFC: Add a server setting to allow any allocation to throw MEMORY_LIMIT_EXCEEDED
2026-05-27 18:31:23 +00:00
“JiaQi 1d8300c8d1 Merge branch 'master' into kafka-disable-streaming 2026-05-25 09:13:43 +08:00
Alexey Milovidov 21b4081888 Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables
# Conflicts:
#	src/Functions/FunctionsStringHash.cpp
#	src/Functions/h3PolygonToCells.cpp
#	src/Parsers/ASTIndexDeclaration.h
2026-05-23 07:39:04 +00:00
Alexey Milovidov 724a4d6428 Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	src/Functions/seriesPeriodDetectFFT.cpp
#	src/Functions/stl.hpp
#	src/Functions/tests/gtest_string_similarity.cpp
2026-05-23 07:21:41 +00:00
Nikolai KochetovandGitHub a97f6d5bc1 Merge pull request #98884 from ClickHouse/mutations-analyzer
Enable new analyzer for `MutationsInterpreter` (coded version 3)
2026-05-22 21:06:59 +00:00
Nikolai Kochetov 85937b3981 Add use_analyzer_for_mutations config to override analyzer choice for mutations
When set in the server config, this option overrides the session setting
`allow_experimental_analyzer` for `MutationsInterpreter`. Absent (default)
means the session setting is used.

The override is parsed once per config reload in `Server.cpp` and stored as
a tri-state atomic on the shared context, so each mutation only pays an
atomic load instead of re-reading the config.
2026-05-22 12:39:29 +00:00
Alexey Milovidov ce33069d64 Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	programs/local/fuzzers/clickhouse_fuzzer.cpp
2026-05-21 10:55:59 +00:00
Azat KhuzhinandGitHub 6e73f7c47c Merge branch 'master' into memory-tracker-min-alloc-throw-size 2026-05-21 11:16:28 +02:00
Michael Kolupaev c7dc789329 Merge remote-tracking branch 'origin/master' into fwd 2026-05-20 12:16:13 -07:00
Alexey Milovidov aea7d2eb55 Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables
# Conflicts:
#	src/Functions/UserDefined/UserDefinedWebAssembly.cpp
2026-05-20 17:25:06 +00:00
Jimmy Aguilar MenaandGitHub e9d0340750 Merge pull request #104940 from nauu/fix-keeper
Fix max_memory_usage_soft_limit hot reload
2026-05-20 14:59:04 +00:00
nauu 4e34c94fae fix max_memory_usage_soft_limit hot reload 2026-05-19 23:26:04 +08:00
Azat Khuzhin c01e1a55b2 Add a server setting to allow new() throw MEMORY_LIMIT_EXCEEDED
Add a server setting (`min_allocation_size_to_throw_on_memory_limit`) to
allow any allocation to throw `MEMORY_LIMIT_EXCEEDED`, this should help
with preventing OOMs

Right now, any `new` cannot throw, this is due exception safety issues,
and only explicitly marked can throw `MEMORY_LIMIT_EXCEEDED`.

But this can lead to real OOMs, i.e. when kernel will kill
clickhouse-server, even though we are trying hard to track memory
properly.

Add a server setting `min_allocation_size_to_throw_on_memory_limit`
(UInt64 bytes, default 0). When non-zero, the throwing `operator new`
variants are allowed to raise `MEMORY_LIMIT_EXCEEDED`. _The assumption
is that code with big enough allocations does not exception safety
issues._

Note, places that allows (Allocator)/never allows (malloc)
`MEMORY_LIMIT_EXCEEDED` before are not affected.
2026-05-18 21:07:37 +02:00
“JiaQi 9b97e9dcde Merge branch 'master' into kafka-disable-streaming 2026-05-16 17:07:46 +08:00
Michael Kolupaev 1eb5502983 Merge remote-tracking branch 'origin/master' into fwd 2026-05-15 22:48:52 -07:00
Alexey Milovidov 19127dec50 Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables
# Conflicts:
#	src/IO/S3RequestSettings.cpp
#	src/Processors/Formats/Impl/ArrowFieldIndexUtil.h
2026-05-15 17:49:34 +00:00
Alexey Milovidov 4ed57d0565 Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	src/Interpreters/ServerAsynchronousMetrics.cpp
2026-05-15 17:03:06 +00:00
Alexey MilovidovandGitHub bc91918852 Merge pull request #100277 from ClickHouse/webterminal
Add web terminal interface to clickhouse-server
2026-05-15 17:54:21 +02:00
Michael Kolupaev 60e30e91b4 Merge remote-tracking branch 'origin/master' into fwd 2026-05-14 12:45:22 -07:00
“JiaQi 56f366a0ea fix tests 2026-05-14 17:53:10 +08:00
“JiaQi 3e78ce0f7f fix tests 2026-05-14 17:44:42 +08:00
Alexey Milovidov 9567f0d9ba Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables
# Conflicts:
#	src/Processors/QueryPlan/Optimizations/Optimizations.h
#	src/Storages/MaterializedView/RefreshTask.cpp
2026-05-08 03:15:33 +00:00
Raúl Marín 031d2e81f5 Merge remote-tracking branch 'blessed/master' into remove-settings-vtable-v2
# Conflicts:
#	src/Core/BaseSettings.h
#	src/Core/SettingsFields.h
2026-05-07 10:39:35 +02:00
Alexey MilovidovandClaude Opus 4.7 02307d091e Address review: more narrowed pragmas and anonymous namespaces
- `arrayAggregation.cpp`, `distanceTransposed.cpp`, `randDistribution.cpp`,
  `toDecimalString.cpp`, `geohashesInBox.cpp`, `seriesPeriodDetectFFT.cpp`:
  drop the file-wide `-Wdouble-promotion` pragma in favor of explicit
  `static_cast` at the actual conversion sites or qualified `std::sqrt`.
- `KeeperDataDumper.cpp`, `LocalServer.cpp`,
  `ChecksumForCompressedBlock.cpp`, `tcp_protocol_fuzzer.cpp`,
  `Server.cpp`: replace `static` on free functions with anonymous
  namespaces, matching the project preference Algunenano flagged.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-06 20:06:41 +00:00
Alexey Milovidov 7d54e33c7c Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	programs/main.cpp
2026-05-06 03:18:15 +00:00
Alexey Milovidov f29d428d82 Merge remote-tracking branch 'origin/master' into webterminal 2026-05-05 18:49:01 +00:00
Nikita Taranov 9be80201af review fixes 2026-05-04 16:04:16 +00:00
Nikita TaranovandClaude Opus 4.6 9e558cc984 Enable query profiler under sanitizer builds
The query profiler was disabled under sanitizers because libunwind's
async stack unwinding interferes with sanitizer internals — sanitizers
modify %rbp during their own frame-walking, and a profiling signal
arriving mid-unwind would crash in libunwind.

Replace libunwind with abseil's frame-pointer-based stack unwinding
under sanitizers. Abseil's `GetStackTrace` / `GetStackTraceWithContext`
use `NO_SANITIZE_ADDRESS/MEMORY/THREAD` attributes and are safe.

Key changes:

  StackTrace.cpp: use `absl::GetStackTrace[WithContext]` under SANITIZER
  instead of `unw_backtrace` / libunwind.

  QueryProfiler.cpp: remove the SANITIZER throw guards that disabled the
  profiler. Skip `hasPHDRCache` check under sanitizers (not needed for
  frame-pointer unwinding). Skip `sigsetjmp` protection under sanitizers
  (TSan wraps signal delivery, making `siglongjmp` across its frames
  unsafe).

  Server.cpp: bypass `hasPHDRCache` for `TraceCollector` init under
  sanitizers. Under TSan the PHDR cache is not created (TSan intercepts
  `dl_iterate_phdr`), but frame-pointer unwinding does not need it.

  Defines.h, SettingsQuirks.cpp: enable profiler default sample rate and
  remove the quirk that force-zeroed profiler settings under sanitizers.

  build_clang_builtin.cmake: build compiler-rt with
  `-fno-omit-frame-pointer` and `-DCOMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG=OFF`
  so that sanitizer runtime frames (e.g. TSan interceptors) have frame
  pointers, allowing abseil's walker to traverse them.

  sleep.cpp: under TSan, use `nanosleep` instead of `clock_nanosleep`.
  TSan intercepts `nanosleep` (setting `in_blocking_func`), which causes
  profiling signals to be delivered immediately rather than deferred.
  Without this, TSan defers the signal and the saved `ucontext_t` may
  point to stale stack memory.

  Tests: remove no-tsan/no-asan/no-ubsan/no-msan tags from query
  profiler tests. Add a real-time profiler test using `numbers_mt` which
  reliably produces meaningful traces under TSan.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-04 16:02:29 +00:00
Raúl Marín a988acca9e Merge remote-tracking branch 'blessed/master' into remove-settings-vtable-v2
# Conflicts:
#	src/Storages/MergeTree/MergeTreeSettings.cpp
2026-05-04 11:01:32 +02:00
Alexey Milovidov 8588fcac45 Merge remote-tracking branch 'origin/master' into webterminal 2026-05-01 11:25:01 +00:00
Alexey Milovidov eff6a0e2f1 Merge remote-tracking branch 'origin/master' into revert-98038-revert-96025-clickhouse-help 2026-05-01 03:46:13 +00:00
Alexey Milovidov dd58f83921 Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables 2026-04-30 22:45:44 +00:00
Alexey Milovidov 012bc4535f Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	src/Interpreters/Context.cpp
2026-04-30 21:04:23 +00:00
Alexey Milovidov 6fea7f8a9d Merge remote-tracking branch 'origin/master' into fix-parquet-memory-watermark-autotune 2026-04-30 08:57:18 +00:00
Alexey Milovidov e5191b08cd Merge remote-tracking branch 'origin/master' into webterminal 2026-04-30 07:18:56 +00:00
Alexey Milovidov d4e0cf86b8 Merge remote-tracking branch 'origin/master' into revert-98038-revert-96025-clickhouse-help 2026-04-30 00:47:38 +00:00
Alexey Milovidov c12cbf6d8d Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables 2026-04-29 19:21:50 +00:00
Alexey Milovidov 4c84d69118 Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	src/Interpreters/examples/jit_example.cpp
2026-04-29 14:59:35 +00:00
Alexey MilovidovandGitHub 811710c52b Merge pull request #103693 from Algunenano/dns-resolver-no-eager-init
Skip local-hostname DNS lookup in client startup
2026-04-29 14:15:51 +00:00
Raúl MarínandClaude Opus 4.7 8721378d53 Do not resolve local hostname in DNSResolver singleton ctor
`DNSResolver::Impl::Impl()` was eagerly running
`Poco::Net::DNS::hostName()` followed by `hostByName` on the local
hostname. The cached result is consumed only by
`updateHostNameAndAddresses` (a server-only periodic task) and by
`getHostName`, which has its own lazy fallback. Yet the work happened
inside a process-wide Meyers singleton, so every program that calls
`DNSResolver::instance` paid the cost — including `clickhouse-client`,
`-local`, `-keeper`, and `-disks`.

When the local hostname could not be resolved (a normal occurrence on
fresh CI/EC2 runners where the auto-generated `ip-X-X-X-X` name is
neither in `/etc/hosts` nor served by the VPC resolver), the catch
block in the constructor logged a stack trace at error level. The
fast-test runner treats any stderr output as a test failure, so this
infrastructure flake masqueraded as a per-test failure.

Move the eager priming out of the singleton constructor:
* `Impl::Impl` is now defaulted; non-server programs no longer touch
  the local hostname during startup.
* `programs/server/Server.cpp` calls `updateHostNameAndAddresses`
  explicitly before starting `DNSCacheUpdater`, so the first cache
  tick on a healthy server still sees a populated value and does not
  spuriously emit `IPs of host name X have been changed`.

Behaviour from PR #93726 (cluster config reload on host IP change) is
preserved — verified by `test_reload_cluster_config_if_host_address_change`,
which still passes.

Failing fast tests in https://github.com/ClickHouse/ClickHouse/pull/103689
(report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103689&sha=3a119a57269adba3557204ce44e58a65054e31df&name_0=PR&name_1=Fast%20test
)
include `Tests/02001_hostname_test`, `Tests/03213_deep_json`,
`Tests/03638_merge_max_dynamic_subcolumns_in_compact_part`, and
`Tests/02433_default_expression_operator_in`, all hitting the same
`Cannot resolve host (ip-172-31-33-233)` startup path.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-29 03:46:28 +00:00
Alexey Milovidov dae2d6994b Address review: revert ad-hoc low-memory ratio uplifts in Server.cpp
Drop two heuristics added during PR development that override explicit
user-configured ratios on small systems:

- Forced uplift of `max_server_memory_usage_to_ram_ratio` to `0.95` when
  RAM < 4 GiB.
- Forced cap of `merges_mutations_memory_usage_to_ram_ratio` to `0.1`
  when RAM < 4 GiB.

Per reviewer feedback: too ad-hoc, removing for now. The remaining
auto-tuning (Parquet watermark, INSERT block size, background pool,
jemalloc dirty decay) is sufficient for the low-memory case and does not
silently override explicit operator settings.
2026-04-29 02:51:34 +00:00
Alexey Milovidov eb4a2eb181 Merge remote-tracking branch 'origin/master' into clang-tidy-init-variables
# Conflicts:
#	src/Processors/Formats/Impl/ParquetBlockInputFormat.cpp
#	src/Processors/Formats/Impl/ParquetBlockInputFormat.h
2026-04-28 14:05:11 +00:00
Alexey Milovidov 4533202826 Merge remote-tracking branch 'origin/master' into revert-98038-revert-96025-clickhouse-help
# Conflicts:
#	programs/main.cpp
2026-04-28 00:04:50 +00:00
Alexey Milovidov 394853b1cc Merge remote-tracking branch 'origin/master' into mdraid-resync-warning 2026-04-27 20:50:01 +00:00
Alexey Milovidov aae661b60c Merge remote-tracking branch 'origin/master' into fix-parquet-memory-watermark-autotune 2026-04-27 18:43:02 +00:00