The userspace page cache (`page_cache_max_size`) was never initialized
in `clickhouse-local`. The `setPageCache` call only existed in
`programs/server/Server.cpp` but was missing from
`programs/local/LocalServer.cpp`.
This adds the same page cache initialization (including validation
of `page_cache_min_size` vs `page_cache_max_size`) to `clickhouse-local`,
enabling the page cache for S3/object storage queries.
Closes https://github.com/ClickHouse/ClickHouse/issues/99499
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Add missing `extern` for `jemalloc_profiler_sampling_rate` in
`Keeper.cpp`, `LocalServer.cpp`, and `Server.cpp`
- Pass `jemalloc_profiler_sampling_rate` as 5th argument to
`Jemalloc::setup` in `Keeper.cpp` and `LocalServer.cpp`
- Expose `prof.lg_sample` via `system.asynchronous_metrics` as
`jemalloc.prof.lg_sample`
- Add integration test `test_jemalloc_profiler_sampling_rate`
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Extract `ErrnoException` into `Common/ErrnoException.h` to reduce the
include footprint of `Exception.h`. This removes `<base/errnoToString.h>`
and `<cerrno>` from `Exception.h`, which is included by ~95% of all
translation units.
All files referencing `ErrnoException` now include the new header
directly. Files that used `errnoToString` without `ErrnoException`
got an explicit `<base/errnoToString.h>` include.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Allow overriding the default access control improvements via an
explicitly provided config file, instead of unconditionally hardcoding
them to true.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Wrap long lines in `getHelpHeader` and `getHelpFooter` for `clickhouse client`
and `clickhouse local` to keep lines within reasonable width,
fixing the 00910_client_window_size_detection test
- Use `createOptionsDescription` instead of raw `po::options_description` constructor
in `git-import` and `static-files-disk-uploader` to handle zero terminal width
properly, fixing the `git-import --help` abort in debug builds
(03823_clickhouse_help_return_codes test)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit improves the help output for all ClickHouse applications:
- Add `clickhouse help` command that lists all available subcommands
- Return exit code 0 for all help messages (previously some returned 1)
- Output help messages to stdout instead of stderr
- Use "clickhouse <cmd>" format instead of argv[0] in help messages
- Add dynamic `app_name` detection for `clickhouse client` and `clickhouse local`
to show correct invocation name based on how the binary was called
- Add `--no-sudo` option for `clickhouse start` and `clickhouse restart`
for environments without sudo (e.g., Docker containers)
- Add detailed help headers and footers for client and local with usage examples
Closes#58244
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Set all `access_control_improvements` options to true for stricter
access control behavior in the embedded server config and clickhouse-local.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
The default user in clickhouse-local was missing the access_management
privilege, which caused operations like DROP ROW POLICY IF EXISTS to
fail with ACCESS_DENIED error, even though the user should be unrestricted.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Since posting lists are the largest by the data size, caching them would
reduce I/O and improve the quer performance in consecutive runs.
The cache can be configured via new server settings:
- `text_index_postings_cache_policy`
- `text_index_postings_cache_size`
- `text_index_postings_cache_max_entries`
- `text_index_postings_cache_size_ratio`
and enabled using `use_text_index_postings_cache` setting (disabled by
default).
The header of the text index contains the number of tokens, bloom filter
and sparse index.
Since both bloom filter and sparse index can be relatively large,
caching them would reduce I/O and improve the query performance.
Make the cache configurable by the new server settings:
- `text_index_header_cache_policy`
- `text_index_header_cache_size`
- `text_index_header_cache_max_entries`
- `text_index_header_cache_size_ratio`
Additionally, the header cache can be enabled via a new setting
`use_text_index_header_cache`. By default, cache is disabled.