Skip to content

Move the schema registry clamp bounds to Core/Defines.h - #118953

Merged
rschu1ze merged 2 commits into
ClickHouse:masterfrom
groeneai:move-schema-registry-defines
Sep 9, 2026
Merged

rschu1ze merged 2 commits into
ClickHouse:masterfrom
groeneai:move-schema-registry-defines

Conversation

@groeneai

@groeneai groeneai commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #113787

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):

Not required (code move, no user-visible change).

Description

Requested by @ rschu1ze in review of #113787:
#113787 (comment)

This very central setting header is definitely not the right place for schema registry defines.

MAX_SCHEMA_REGISTRY_TIMEOUT_SECONDS, MAX_SCHEMA_REGISTRY_RETRIES and
MAX_SCHEMA_REGISTRY_INITIAL_BACKOFF_MS move from src/Core/SettingsQuirks.h to
src/Core/Defines.h, together with the comment that explains why the same bounds are applied at
two sites. The values (599, 20, 60000), the explicit UInt64 type and the enclosing
namespace DB are unchanged.

One token is adapted: inline constexpr becomes static constexpr, the specifier Defines.h uses
for all 103 of its existing constants. Nothing takes the address of these three and both consumers
read them by value, so it is inert here; I will switch it back if you prefer the original spelling.

SettingsQuirks.cpp needs no change, since it already includes <Core/Defines.h>.
FormatFactory.cpp was reaching the constants through <Core/SettingsQuirks.h> and uses nothing
else from that header, so that include is replaced by <Core/Defines.h>.

No behaviour change, hence no new test. Validated by a full debug build.


Workflow [PR]
Sync PR [sync-upstream/pr/118953]

Version info

  • Merged into: 26.9.1.1081 (included in 26.9 and later)

`MAX_SCHEMA_REGISTRY_TIMEOUT_SECONDS`, `MAX_SCHEMA_REGISTRY_RETRIES` and
`MAX_SCHEMA_REGISTRY_INITIAL_BACKOFF_MS` were added to `src/Core/SettingsQuirks.h`
by ClickHouse#113787. As @ rschu1ze pointed out while reviewing that PR, "this very central
setting header is definitely not the right place for schema registry defines", and
he asked for them to be moved to `src/Core/Defines.h`, which is where this project
keeps its named magnitude constants.

Requested in
ClickHouse#113787 (comment)

The three definitions move together with the comment block that explains why the
same bounds are applied at two sites. Values (599, 20, 60000), the explicit
`UInt64` type and the enclosing `namespace DB` are unchanged, so both consumers
see exactly what they saw before.

The storage-class specifier is the one adapted token: `inline constexpr` becomes
`static constexpr`, matching the destination file, which uses `static constexpr`
for all 103 of its existing constants and has never contained an `inline constexpr`
one. It is semantically inert here because nothing takes the address of these
constants; both consumers read them by value. The explicit `UInt64` is deliberately
kept rather than switching to the `auto` most of `Defines.h` uses, because `auto` on
`599` would deduce `int` and change the type at the `std::min<UInt64>` and
`CHECK_SETTING_MAX_VALUE` sites.

`SettingsQuirks.cpp` needs no change; it already includes `<Core/Defines.h>`.
`FormatFactory.cpp` had been reaching the constants through its
`<Core/SettingsQuirks.h>` include and uses nothing else from that header, so the
include is replaced by `<Core/Defines.h>`.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Sep 9, 2026
@groeneai

groeneai commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 1 finding over 2 rounds).

# Sev Finding Verdict Evidence / action
1 💡 Changelog category CI Fix or Improvement mislabels a pure src/ relocation AGREE, fixed Changed to Not for changelog. Neither label affects CI job selection or the generated changelog (both are in NO_CHANGELOG_REQUIRED_LABELS, and tests/ci/changelog.py skips both), but Not for changelog is the accurate one.

Re-review after the fix: 0 findings. No source change in either round.

Severity: ❌ blocker / ⚠️ major / 💡 nit.

@clickhouse-gh clickhouse-gh Bot closed this Sep 9, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 9, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9e9c604]

Summary: ✅


AI Review

Summary

This PR moves the schema registry clamp bounds from src/Core/SettingsQuirks.h to src/Core/Defines.h and updates FormatFactory.cpp to include the new header directly. I found no correctness, compatibility, or maintainability issues in the current diff.

Final Verdict

✅ Approved. No new inline findings.

LLVM Coverage Report

Measured on commit 9e9c604.

Metric Baseline Current Δ
Lines 88.90% 88.90% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 81.30% 81.30% +0.00%

Changed lines: Changed C/C++ lines covered: 0/0 (nothing coverable) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added pr-not-for-changelog This PR should not be mentioned in the changelog comp-settings Settings & configuration infrastructure (server/user/query settings, profiles). labels Sep 9, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 9e9c60459 with master 10bec7b88 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

3976 translation units recompiled, 18668 s compile time in total, 3976 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×1.05 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +971.6 s (+5%) in total before that adjustment.

Job report

@rschu1ze
rschu1ze enabled auto-merge September 9, 2026 12:14
@rschu1ze
rschu1ze added this pull request to the merge queue Sep 9, 2026
Merged via the queue into ClickHouse:master with commit 4d7f75e Sep 9, 2026
174 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-settings Settings & configuration infrastructure (server/user/query settings, profiles). groeneai-origin-request PR origin: a maintainer pinged or directed groeneai 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.

4 participants