Skip to content

sync src/Common/FailPoint.cpp src/Common/ProfileEvents.cpp src/Core/ServerSettings.cpp src/Core/Settings.cpp src/Core/SettingsChangesHistory.cpp src/Storages/MergeTree/MergeTreeSettings.cpp - #103269

Merged
fm4v merged 6 commits into
masterfrom
public_sync_1776778847
Apr 21, 2026

Conversation

@fm4v

@fm4v fm4v commented Apr 21, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.4.1.1111

fm4v added 5 commits April 21, 2026 18:43
- `distributed_cache_simulate_stale_connection` failpoint for testing stale pool connection recovery
- `DistrCacheStaleReconnections` profile event for reconnects due to peer-closed pooled connections
- `DistrCacheRemoveOutdatedMicroseconds` profile event for time spent removing outdated pooled connections
- `SharedMergeTreeReplicaSetUpdateTaskRuns` profile event for SMT replica set background update task runs
Wall-clock timeout for the entire TCP handshake phase (Hello + Addendum)
to limit how long an unauthenticated connection can hold a thread.
Set to 0 to disable.
…ax_tries`

- New `http_max_request_header_size` setting caps total HTTP request
  header bytes before authentication.
- New `http_headers_read_timeout` setting bounds total time for reading
  HTTP request headers to protect against slowloris-style attacks.
- Lower defaults for `http_max_fields` (1000000 -> 1000) and
  `http_max_field_name_size` (128 KiB -> 4 KiB) to limit pre-auth memory.
- New `distributed_cache_write_request_max_tries` setting mirrors the
  existing read-side retry setting for write requests.
…nges

Add settings-history entries for:
- `http_max_fields` default lowered to 1000
- `http_max_field_name_size` default lowered to 4 KiB
- `http_max_request_header_size` new setting
- `http_headers_read_timeout` new setting
- `distributed_cache_write_request_max_tries` new setting
- `shared_merge_tree_merge_coordinator_merges_prepare_count` default now `auto`
- `shared_merge_tree_replica_set_max_lifetime_seconds` default raised to 30 minutes
…ed_merge_tree_merge_coordinator_merges_prepare_count` defaults

- Raise `shared_merge_tree_replica_set_max_lifetime_seconds` default
  from 300 to 1800 and clarify the jitter semantics (next run uniform in
  [0, value]; value = 0 is clamped to a 200 ms floor by the implementation).
- Change `shared_merge_tree_merge_coordinator_merges_prepare_count` to
  default to `auto`, which equals max merge tasks per replica multiplied
  by the number of active replicas.
@clickhouse-gh

clickhouse-gh Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [36fb035]

Summary: ⏳

job_name test_name status info comment
Stateless tests (amd_llvm_coverage, 3/3) FAIL
03549_system_query_metric_log_with_queries_with_same_query_id FAIL cidb IGNORED

AI Review

Summary

This PR syncs several settings/profile-events updates, including stricter HTTP header defaults and new header-protection settings, distributed-cache retry settings, and SharedMergeTree settings default/type adjustments. Verdict: request changes due to PR metadata quality mismatch for a user-visible behavior change.

PR Metadata

Changelog category is currently Not for changelog, but this PR changes user-visible defaults (notably http_max_fields, http_max_field_name_size) and introduces new user-facing limits (http_max_request_header_size, http_headers_read_timeout). A changelog entry is required here.

Exact replacement text:

  • Changelog category: Improvement
  • Changelog entry: Reduced default HTTP header limits (http_max_fieldsfrom 1000000 to 1000,http_max_field_name_sizefrom 128 KiB to 4 KiB) and addedhttp_max_request_header_size(10 MiB) plushttp_headers_read_timeout (30s) to mitigate pre-authentication resource exhaustion and slow-header attacks.
Findings

💡 Nits

  • [src/Core/Settings.cpp:2583] PR metadata mismatch: user-visible defaults/limits changed, so Not for changelog is not appropriate. Switch to Improvement and add a specific user-facing entry.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ✅
PR metadata quality ⚠️ Not for changelog does not match user-visible default/limit changes in HTTP settings.
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict

Status: ⚠️ Request changes

Minimum required actions:

  1. Update PR template metadata to Changelog category: Improvement.
  2. Add a specific user-facing Changelog entry describing the HTTP header defaults/limits changes.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Apr 21, 2026
Comment thread src/Core/Settings.cpp Resolved
Without this, the `CLICKHOUSE_CLOUD` build fails to compile the
`default_distributed_cache_write_request_max_tries` initializer in
`src/Core/Settings.cpp` introduced in the previous commit.
Comment thread src/Core/Settings.cpp
- Positive integer.
)", 0) \
DECLARE(UInt64, http_max_fields, 1000000, R"(
DECLARE(UInt64, http_max_fields, 1000, R"(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is user-visible (http_max_fields drops from 1000000 to 1000, plus new HTTP header limit/time settings), but the PR metadata is currently Not for changelog with no concrete entry.

Please switch Changelog category to Improvement and add a user-facing Changelog entry that explicitly mentions the new defaults and limits.

@fm4v
fm4v added this pull request to the merge queue Apr 21, 2026
@clickhouse-gh

clickhouse-gh Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.10% +0.00%
Functions 91.10% 91.10% +0.00%
Branches 76.50% 76.50% +0.00%

Changed lines: 100.00% (103/103) · Uncovered code

Full report · Diff report

Merged via the queue into master with commit a7b13e0 Apr 21, 2026
154 of 160 checks passed
@fm4v
fm4v deleted the public_sync_1776778847 branch April 21, 2026 20:26
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 21, 2026
fm4v added a commit that referenced this pull request Apr 21, 2026
The previous commit's baselines were produced by a stale 26.4.1.1
build (git hash aa5df02), missing ~8600 dev-cycle commits worth of new
and changed settings. Regenerate with the 26.4.1.1110 binary (git hash
a2e567a), which is 15 commits shy of the new VERSION_GITHASH.

Manually patch the 7 settings introduced or changed by the sync PR
#103269 that landed between a2e567a and master HEAD so the baseline
reflects the final state of the 26.4 dev cycle:
  session settings:
    + distributed_cache_write_request_max_tries = 10
    + http_max_request_header_size              = 10485760
    + http_headers_read_timeout                 = 30
    http_max_fields              1000000 -> 1000
    http_max_field_name_size     131072  -> 4096
  merge tree settings:
    shared_merge_tree_replica_set_max_lifetime_seconds  300 -> 1800

(shared_merge_tree_merge_coordinator_merges_prepare_count became
UInt64Auto; the test's `default NOT LIKE '%auto(%'` filter excludes it
from comparison, so no baseline edit is needed.)
fm4v added a commit that referenced this pull request Apr 21, 2026
…t to auto

The setting changed from UInt64 default 100 to UInt64Auto default 'auto'
in the 26.4 dev cycle (sync PR #103269). The test's NOT LIKE '%auto(%'
filter does not exclude the literal 'auto' (no parentheses), so the
setting stays in new_merge_tree_settings and the baseline must match.
CheSema added a commit that referenced this pull request Apr 27, 2026
The cherry-pick of #103284 dropped the `DECLARE(UInt64,
handshake_timeout_milliseconds, ...)` line from
`src/Core/ServerSettings.cpp` while keeping the matching `extern` in
`src/Server/TCPHandler.cpp`. As a result, all `Build` jobs on this
backport fail with:

    ld.lld-21: error: undefined symbol: DB::ServerSetting::handshake_timeout_milliseconds
    >>> referenced by TCPHandler.cpp:360 (TCPHandler.cpp.o)

Re-add the missing declaration. On `master` and on the `26.4` branch
the same line is already present (it landed earlier via the sync
PR #103269), so this commit only changes the older release branches
where the cherry-pick lost it.
CheSema added a commit that referenced this pull request Apr 27, 2026
The cherry-pick of #103284 dropped the `DECLARE(UInt64,
handshake_timeout_milliseconds, ...)` line from
`src/Core/ServerSettings.cpp` while keeping the matching `extern` in
`src/Server/TCPHandler.cpp`. As a result, all `Build` jobs on this
backport fail with:

    ld.lld-21: error: undefined symbol: DB::ServerSetting::handshake_timeout_milliseconds
    >>> referenced by TCPHandler.cpp:360 (TCPHandler.cpp.o)

Re-add the missing declaration. On `master` and on the `26.4` branch
the same line is already present (it landed earlier via the sync
PR #103269), so this commit only changes the older release branches
where the cherry-pick lost it.
CheSema added a commit that referenced this pull request Apr 27, 2026
The cherry-pick of #103284 dropped the `DECLARE(UInt64,
handshake_timeout_milliseconds, ...)` line from
`src/Core/ServerSettings.cpp` while keeping the matching `extern` in
`src/Server/TCPHandler.cpp`. As a result, all `Build` jobs on this
backport fail with:

    ld.lld-21: error: undefined symbol: DB::ServerSetting::handshake_timeout_milliseconds
    >>> referenced by TCPHandler.cpp:360 (TCPHandler.cpp.o)

Re-add the missing declaration. On `master` and on the `26.4` branch
the same line is already present (it landed earlier via the sync
PR #103269), so this commit only changes the older release branches
where the cherry-pick lost it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants