Commit Graph
10962 Commits
Author SHA1 Message Date
Azat Khuzhin 8822a14645 Merge pull request #127717 from nikita-vanyasin/text-log-level-root-logger-level
Take an explicitly configured text_log.level into account when updating logger levels
2026-10-26 16:40:15 +00:00
Alexey Milovidov 4451bca49a Merge pull request #127100 from groeneai/iceberg-read-manifests-on-io-pool
Read Iceberg manifest files on the IO thread pool and remove the manifest decode pool
2026-10-25 14:01:28 +00:00
Nikita VaniasinandClaude Fable 5.1 68f368c344 Document how text_log.level interacts with the root logger level
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-24 12:14:05 +02:00
Alexey Milovidov 5a33e42372 Merge pull request #126157 from ClickHouse/register-xml-dictionaries-before-tables
Register XML dictionaries before loading tables at startup
2026-10-24 00:05:33 +00:00
Alexey Milovidov dad1ac0790 Merge remote-tracking branch 'origin/master' into iceberg-read-manifests-on-io-pool 2026-10-23 20:44:09 +00:00
Alexey Milovidov 8e4e99ea15 Merge remote-tracking branch 'origin/master' into iceberg-read-manifests-on-io-pool 2026-10-22 23:52:29 +00:00
George Larionov b22e47141b Merge remote-tracking branch 'origin/master' into ai-functions/ai-service-static-pool 2026-10-22 22:34:02 +00:00
Pedro Ferreira 518930057a Oracle fix for SummingMergeTree 2026-10-22 16:52:18 +00:00
Alexey Milovidov 9ce1640e29 Merge pull request #126638 from davidrz15/epipe_fix
Terminate query quietly on EPIPE signal
2026-10-21 20:14:09 +00:00
Vladimir Cherkasov ba38c73d79 Merge pull request #125823 from ClickHouse/vdimir/totp-second-factor-no-password-leak
Return `REQUIRED_SECOND_FACTOR` regardless of the password when the TOTP code is missing
2026-10-21 13:45:30 +00:00
Alexey Milovidov 76789fd8b2 Merge remote-tracking branch 'origin/master' into HEAD 2026-10-21 07:26:21 +00:00
Groene AIandClaude Opus 5.5 aff0a33949 Iceberg: read manifest files on the IO thread pool, parse them on the reading threads
A manifest walk over an Iceberg table with many manifests was bounded by
`iceberg_manifest_decode_concurrency`: fetching a manifest (a remote round trip)
and parsing it (CPU, about 2 ms per manifest) were one task on a dedicated pool,
so only that many round trips overlapped (issue #127061: 671 manifests, 9.6 s at
4, 4.0 s at 32).

Manifest files are now read ahead on the IO thread pool, 64 at a time and at most
64 MiB of manifests not in the metadata files cache, and nothing is parsed there.
The read goes through `getOrSetManifestFile` as before, so concurrent queries
still share one read per manifest and `SYSTEM CLEAR ICEBERG METADATA CACHE` keeps
its semantics; the cached cell holds the bytes and parses them on the first
`getDeserializer()` call (`std::call_once`).

The threads that call `IcebergIterator::next` parse the manifests: each one
continues an idle partially read manifest or parses the next one, so parsing
keeps the parallelism of the reading threads; with one reading thread the files
come in the manifests' order as before. Delete manifests are parsed by the
threads that need them, and the last one sorts the deletes. `totalRows` reads
ahead and parses on the calling thread.

Removed: the manifest decode thread pool and its metrics, the producer thread,
the bounded queue and the stop flag of `ManifestFileIterator`,
`ParallelManifestDecode.h`. The query settings `iceberg_manifest_decode_concurrency`
(and its old name `iceberg_delete_manifest_decode_concurrency`) and
`iceberg_file_entries_queue_size`, and the server settings
`max_iceberg_manifest_decode_thread_pool_size`,
`max_iceberg_manifest_decode_thread_pool_free_size` and
`iceberg_manifest_decode_thread_pool_queue_size` are obsolete: accepted and ignored.

The integration tests of the decode concurrency now vary `max_threads` instead;
the test of the removed pool and the timing test of the removed setting are
deleted.

Closes #127061

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 02:07:03 +00:00
Kaviraj Kanagaraj 7f172839e1 Merge pull request #99702 from kavirajk/kavirajk/system-connections-table
feat: support `system.connections` table for client connections metadata
2026-10-20 21:09:17 +00:00
Alexey Milovidov 63b1512d6f Merge pull request #106270 from ClickHouse/keeper-snapshot-stats
Improvements to keeper-utils analyze-snapshot
2026-10-20 19:24:11 +00:00
vdimir 710913f376 handle REQUIRED_SECOND_FACTOR in Client::connect() 2026-10-20 16:44:31 +00:00
George Larionov 1d312f70f9 Merge master into ai-functions/ai-service-static-pool 2026-10-20 16:01:36 +00:00
vdimir b3f82c260c Merge branch 'master' into vdimir/totp-second-factor-no-password-leak
# Conflicts:
#	src/Access/Authentication.cpp
2026-10-20 14:18:29 +02:00
Konstantin Vedernikov 4ea0d9220a Merge pull request #122867 from ClickHouse/gpu_mem
[GPU] utils to work with GPU memory and cuDF 1/N
2026-10-19 20:21:31 +00:00
Konstantin VedernikovandClaude Opus 5.5 2ce250a2f9 Merge remote-tracking branch 'origin/master' into gpu_mem
Resolve conflicts in the `dlopen` guard in `programs/main.cpp` and
`programs/keeper/keeper_main.cpp`: keep the guards identical (as master now
requires) and keep `USE_GPU` from this branch in both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 17:25:37 +00:00
Shaun Struwig c1f6b9b32d Merge pull request #126357 from ClickHouse/fix-broken-links
Replace broken links in source code comments
2026-10-19 08:23:06 +00:00
Alexey Milovidov a5a3411cd1 Merge remote-tracking branch 'origin/master' into HEAD 2026-10-19 03:38:28 +00:00
Alexey MilovidovandClaude Opus 5.5 d011ea7ff1 Stop the client quietly on EPIPE on its own stdout only
The previous approach was unsafe:

- Swallowing `EPIPE` in `WriteBufferFromFileDescriptor::nextImpl` affected every
  pipe, also on the server: data written to a child process that exited early was
  silently dropped, and `UserDefinedExecutableFunctionDriverInvoker` and
  `clickhouse-disks sed`, which catch the `EPIPE` `ErrnoException`, would get a
  `LOGICAL_ERROR` exception from `finalize` of the silently canceled buffer.
- Ignoring `SIGPIPE` in the client was redundant: Poco already blocks it in all
  threads, which is why the write fails with `EPIPE` at all. And an ignored signal
  is inherited through `exec`, while `ShellCommand` resets only the signal mask, so
  the pager and executable UDFs started by `clickhouse-local` would inherit it.

Instead, the console output buffer of the client remembers that its write failed
with `EPIPE`. Then the client does not print the error, does not run further
queries (even with `--ignore-error`), and exits with code 0.

Closes: https://github.com/ClickHouse/ClickHouse/issues/126443

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 03:36:58 +00:00
Alexey Milovidov ea3c3d1a43 Merge pull request #125548 from ringerc/fix-keeper-main-dlopen-fips-guard
Fix linker error "duplicate symbol: main" on  -DUSE_OPENSSL_FIPS=1 builds
2026-10-19 00:24:29 +00:00
Alexey Milovidov 882f3e0e61 Merge pull request #125939 from ClickHouse/play-format-multi-statement
Support multi-statement input in the "Format" button of the Web UI
2026-10-18 21:51:03 +00:00
Alexey Milovidov 787032b220 Merge remote-tracking branch 'origin/master' into HEAD 2026-10-18 19:09:56 +00:00
Alexey MilovidovandClaude Opus 5.5 f7225e875e Address review: keep a leading BOM in the Web UI lexer tokens
`tokenizeSync` decoded each token with a default `TextDecoder`, which strips a
leading `U+FEFF`. The token lengths then no longer matched the original text,
so the statement offsets used by the multi-statement "Format" button were off
by one and a BOM-prefixed `select 1;` was sent as `select `. Decode with
`ignoreBOM: true` and add a regression case to the harness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 02:14:40 +00:00
Alexey Milovidov f2a7554f4c Merge remote-tracking branch 'origin/master' into HEAD 2026-10-18 02:11:43 +00:00
Julia Kartseva 0a738e2839 Merge remote-tracking branch 'origin/master' into HEAD 2026-10-17 14:39:19 +00:00
Sergei Trifonov 76cb67e410 Merge pull request #124938 from ClickHouse/multiple-static-worker-clusters
Multiple static stateless worker clusters, selectable per query
2026-10-17 13:15:57 +00:00
Alexey MilovidovandClaude Opus 5.5 7ba3651786 Address review: register XML dictionaries before loading the system database
`loadMetadataSystem` attaches the persisted tables of the `system` database
before the other databases, so a table in `system` with a projection using
`dictGet` on an XML dictionary was still attached while the dictionary was
unknown. Register the dictionaries right after the temporary database is
loaded, and run the regression test for a table in `system` too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:09:03 +00:00
Kaviraj 5ef4b3a588 Merge branch 'master' into kavirajk/system-connections-table 2026-10-17 07:22:21 +00:00
Michael KolupaevandClaude Fable 5.1 7b210c6b7f keeper-utils snapshot-analyzer: finish --top-children, fix error handling and ordering
The previous commit added `TopChildrenTracker` and the `--top-children` option but did
not wire them into `analyzeSnapshot`, so the build failed with `-Wmissing-prototypes`
(the definition did not match the declaration) and clang-tidy reported the tracker as
unused:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=106270&sha=d74d5b7fedcbac408f79a2a316b08d673d2406f7&name_0=PR&name_1=Fast%20test
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=106270&sha=d74d5b7fedcbac408f79a2a316b08d673d2406f7&name_0=PR&name_1=Build%20%28arm_tidy%29
PR: https://github.com/ClickHouse/ClickHouse/pull/106270

Also address review comments:
- A failure to analyze a single snapshot file now propagates, so the command exits
  with a non-zero code instead of just printing to stderr. In directory mode the
  remaining snapshots are still analyzed, but an exception is thrown at the end if
  any of them failed.
- Snapshots in a directory are sorted by the log index parsed from the file name
  (`getLogIdxFromSnapshotPath`) instead of lexicographically, so `snapshot_10.bin`
  really comes before `snapshot_9.bin`.
- Whether `--snapshot-path` is a file or a directory is decided by `is_directory`
  instead of the file extension.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16 19:06:13 -07:00
Michael Kolupaev 76e82a0ab6 Merge remote-tracking branch 'origin/master' into keeper-snapshot-stats-wip 2026-10-16 18:50:15 -07:00
Groene AIandClaude Opus 5.5 29dad409f8 Drain the late backup and restore parts only after the forced exit check
Stopping the DDL worker joins the task it runs, including ones that are not
backups or restores. Before the connection wait, a `TRUNCATE ... ON CLUSTER`
waiting in `lockExclusively` for a lock held by a native `INSERT` that waits for
client data kept the shutdown waiting until `lock_acquire_timeout`, instead of
exiting forcefully after `shutdown_wait_unfinished` as master does (66.0 s vs
5.5 s with `shutdown_wait_unfinished = 5` and `lock_acquire_timeout = 60`).

The first kill stays where master has it and still spares the DDL worker's
parts, which keep running during the connection wait. After the forced exit
check, the remaining queries are cancelled again, as `ContextSharedPart::shutdown`
does before it stops the DDL worker, then the DDL worker is stopped and all
backups and restores are waited for, still before the AsyncLoader stops. Both
`shutdown_wait_unfinished_queries` modes now use the same place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:03:05 +00:00
Julia Kartseva a465eb0cfe Merge remote-tracking branch 'origin/master' into HEAD 2026-10-16 22:03:00 +00:00
Alexey MilovidovandClaude Opus 5.5 2c40a0d8e4 Replace broken links in source code comments
Dead links are replaced with their new locations (moved GitHub repositories
and files, pinned to a tag or commit where the line number matters) or with
Web Archive snapshots when the original site is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:19:00 +00:00
Alexey Milovidov 45ccaa5442 Merge pull request #120758 from ClickHouse/statistics-cache-per-part
Cache statistics per data part and column instead of per set of parts
2026-10-16 18:25:57 +00:00
Sergei Trifonov 92f7b09714 Merge remote-tracking branch 'origin/master' into multiple-static-worker-clusters
# Conflicts:
#	src/QueryPipeline/DistributedPlanExecutor.cpp
2026-10-16 17:52:19 +00:00
Kaviraj a3bd14124c chore: address PR remarks
Basically two minor changes
1. Make the setting `collect_connection_metrics` reloadable at the
   runtime (via SYSTEM RELOAD CONFIG for example). To make this
   possible, now we check for registeration before each query during
   HTTP. Common how it's done in other places
2. Make connection_Id UUID instead of Uint64. To avoid complexities and
   conflict during cluster mode.

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
2026-10-16 15:18:21 +00:00
Pedro Ferreira 03e16d88f9 Merge pull request #124915 from groeneai/fix-command-line-config-section-without-file-section
Apply configuration sections given only on the command line
2026-10-16 10:19:11 +00:00
Groene AIandClaude Opus 5.5 163c3c51d1 Wait for the late backup and restore parts before the AsyncLoader stops
The parts of ON CLUSTER backups and restores that the DDL worker registers after
the shutdown wait were spared by both shutdown kills and left to
`BackupsWorker::shutdown`. That runs in `Context::shutdown`, after the scope
guard in `Server.cpp` has already shut down the AsyncLoader. A late
`RESTORE DATABASE ... ON CLUSTER` of a dropped database then fails on the host
being restarted: `InterpreterCreateQuery::createDatabase` schedules the
database's startup job, and `AsyncLoader::schedule` throws
`ASYNC_LOAD_CANCELED: AsyncLoader was shut down: While creating database mydb`.

Drain those parts in `Server.cpp`, before the AsyncLoader stops: kill the other
queries as before, stop the DDL worker (which makes every part it delivered
registered), and wait for all backups and restores again. By default this
happens right after the existing kill. With `shutdown_wait_unfinished_queries`
there is no kill there, so the same kill and drain run after the queries were
waited for. Late initiators are still cancelled before the DDL worker stops,
because an initiator's own part needs it.

A DDL worker whose startup job has not run yet must not be started after it is
stopped, so the drain first removes that job from the AsyncLoader (cancelling
it if pending, waiting for it if running).

Since no such part outlives the drain, the `ContextSharedPart::shutdown` reorder
and its sparing kill are reverted to master. The only path that skips the drain
is a startup failure, where the DDL worker is not running.

The restore shutdown test now restores a dropped database, so it covers the
database and table creation, and it runs twice: restarting node2 (default
settings) and restarting node3, which has `shutdown_wait_unfinished_queries`.
- master shutdown code: RESTORE_CANCELLED (both cases)
- previous head (541c81bf): RESTORE_FAILED, ASYNC_LOAD_CANCELED (both cases)
- this commit without the drain after the query wait: RESTORE_CANCELLED in the
  `shutdown_wait_unfinished_queries` case
- this commit (9120585a): RESTORED (both cases, 3/3 each)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:55:16 +00:00
Alexey MilovidovandClaude Opus 5.5 83010829c2 Address review: harden multi-statement Format in the Web UI
- `splitAllQueries`: the lexer stops at the first error (e.g. an unterminated
  string literal or comment), so the unlexed remainder was dropped and Format
  would edit only the valid prefix. The remainder now belongs to the last
  statement, so the server reports the error and the editor is unchanged.
- Format: re-check the connection, tab and text after awaiting the splitter
  (which loads the lexer on first use), so the text is never sent with the
  credentials of a connection selected after the click.
- Update the Format fixture of `test_play_reconcile_startup` for the new `f<N>`
  aliases and cover multiple statements, all-or-nothing errors, lexer errors and
  a connection change during the lexer load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:08:57 +00:00
Nikolay Degterinsky 46932ee3b0 Merge pull request #124940 from evillique/sync-forbid-sql-access-entities-targeting-users-config
Sync private changes: forbid SQL access entities targeting users.xml users
2026-10-16 00:02:17 +00:00
Alexey MilovidovandClaude Opus 5.5 66d2e27434 Register XML dictionaries before loading tables at startup
The definitions of the dictionaries from the configuration files were added to
`ExternalDictionariesLoader` only after `loadMetadata`, so a table referring to
such a dictionary was attached while the dictionary was unknown: the dependency
was dropped by `TablesLoader::removeUnresolvableDependencies` as nonexistent,
and a projection using `dictGet` could not be analyzed and was skipped.

Now the configuration repository is registered before `loadMetadata`, while
automatic loading is disabled in the loader until `loadOrReloadDictionaries`,
so no dictionary starts loading earlier than before.

Closes: https://github.com/ClickHouse/ClickHouse/issues/67521

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 23:49:31 +00:00
Sergei Trifonov 4f73693529 Merge pull request #117711 from ClickHouse/io-aware-cpu-lease
I/O-aware CPU leases: release the CPU slot during non-CPU waits
2026-10-15 19:38:07 +00:00
Nikolay Degterinsky e444dde4d8 Merge remote-tracking branch 'upstream/master' into sync-forbid-sql-access-entities-targeting-users-config
# Conflicts:
#	src/Access/AccessControl.h
2026-10-15 19:12:38 +00:00
Groene AIandClaude Opus 5.5 aaf3d84eb4 Probe only MapConfiguration layers for a child-only node, and find its keys by lower_bound
A lookup that misses no longer repeats the node search of every XML layer: `XMLConfiguration`
already reports a node that has children, so `LayeredConfiguration::getRaw` probes only the flat
`MapConfiguration` layers, and `MapConfiguration::enumerate` starts at `lower_bound(prefix)`
instead of scanning the whole map. On a server-shaped configuration (programs/server/config.xml,
the command line of CI's replica server, the application and system layers; debug build) a
missing key now costs 1036 ns, against 907 ns on master and 1934 ns before this change; a key
that exists is unchanged (318 ns).

A section given only on the command line reads as "" through `getString(section, default)`, and
`getInt(section, default)` throws; the comment in `getRaw` states this.

`remote_servers` stays file-only. `Cluster` takes the server's own `tcp_port` from that
configuration to find its local replicas, so with the command line on top, a server started with
`-- --tcp_port` treats the replicas on the file's port as remote: measured `is_local` 1 -> 0 and
`cluster()` failing with `ALL_CONNECTION_TRIES_FAILED`, which is the shape the performance job
uses (servers on 9001/19001, `test_cluster_two_shard_three_replicas_localhost` on 9000).

https://github.com/ClickHouse/ClickHouse/pull/124915#issuecomment-6192247516

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:35:05 +00:00
Alexey Milovidov 0acd8e6df3 Merge remote-tracking branch 'origin/master' into HEAD 2026-10-15 12:31:49 +00:00
Alexey MilovidovandClaude Opus 5.5 4b7bc34d8c Support multi-statement input in the "Format" button of the Web UI
Split the editor's text into statements with `splitAllQueries`, format all of
them in one request (`SELECT formatQuery({q0:String}) AS f0, ...`), and replace
each statement in place. The `;` delimiters, whitespace, and comments between
statements are kept as is.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 06:22:41 +02:00
Alexey Milovidov 0f5adf1798 Merge pull request #115004 from ClickHouse/obfuscate-function
Add table function `obfuscate`
2026-10-15 00:52:12 +00:00