Repository navigation
Move the schema registry clamp bounds to Core/Defines.h - #118953
Conversation
`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]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding over 2 rounds).
Re-review after the fix: 0 findings. No source change in either round. Severity: ❌ blocker / |
|
Workflow [PR], commit [9e9c604] Summary: ✅
AI ReviewSummaryThis PR moves the schema registry clamp bounds from Final Verdict✅ Approved. No new inline findings. LLVM Coverage ReportMeasured on commit 9e9c604.
Changed lines: Changed C/C++ lines covered: 0/0 (nothing coverable) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units3976 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. |
Related: #113787
Changelog category (leave one):
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)
MAX_SCHEMA_REGISTRY_TIMEOUT_SECONDS,MAX_SCHEMA_REGISTRY_RETRIESandMAX_SCHEMA_REGISTRY_INITIAL_BACKOFF_MSmove fromsrc/Core/SettingsQuirks.htosrc/Core/Defines.h, together with the comment that explains why the same bounds are applied attwo sites. The values (599, 20, 60000), the explicit
UInt64type and the enclosingnamespace DBare unchanged.One token is adapted:
inline constexprbecomesstatic constexpr, the specifierDefines.husesfor 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.cppneeds no change, since it already includes<Core/Defines.h>.FormatFactory.cppwas reaching the constants through<Core/SettingsQuirks.h>and uses nothingelse 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
26.9.1.1081(included in26.9and later)