Repository navigation
Add a "private preview" feature tier between experimental and beta - #113581
nikitamikhaylov merged 2 commits into
Conversation
Feature tiers were PRODUCTION, OBSOLETE, EXPERIMENTAL and BETA. This adds a
fourth maturity tier for features on a clear path to general availability whose
applicability is still limited and which are not recommended for production
use, so the tiers are ordered
experimental < private preview < beta < production
and extends allow_feature_tier accordingly. Requested in ClickHouse#113481; the
numbering below was confirmed by the issue author.
allow_feature_tier becomes a four-level gate: 0 allows every tier, 1 excludes
experimental, 2 additionally excludes private preview, and 3 allows production
settings only. Only 2 changes meaning. 0 still grants everything, and 1 still
grants everything except experimental, because the tier it newly admits
contains no setting: this change deliberately moves no existing setting into
the new tier, which is a product decision for the issue author. 3 is new and
carries today's 2 semantics. The single upgrade-visible change is that a
server pinned at allow_feature_tier = 2 gains beta writability; operators
wanting the old behaviour move to 3. The default stays 0, so no default moves.
Flags::TIER was exactly two bits with all four encodings taken, so it is
widened to three (0x0c -> 0x1c). Every pre-existing encoding decodes
identically under the wider mask, which stays disjoint from IMPORTANT, CUSTOM
and HOT_RELOAD. The new tier is appended (= 16) rather than inserted, so no
existing value of the user-visible system.settings.tier enum moves, and 16
fits int8_t as DataTypeEnum8 requires. BaseSettingsHelpers::getTier holds the
only relational comparison on the enum in the tree and is re-keyed to the new
maximum; without that, every private-preview setting would throw
INCORRECT_DATA at decode.
The tier bits are never serialized. Flags::TIER appears once in all of src/,
the only flags ever OR-ed into a serialized word are IMPORTANT and CUSTOM, and
writeChangedBinary writes an empty flags word, so no wire format changes and
no protocol-version guard is needed.
Every other consumer tests one specific tier with == or !=, so a new tier
would otherwise be silently ungated or silently unreported. All of them gain
an explicit branch: the query-settings gate, the MergeTree table-settings gate
and its five callers, both directions of the allow_feature_tier mapping (the
inverse feeds system.server_settings, which would misreport the level
otherwise), the user-visible Enum8 and the documentation generator. Sites
testing OBSOLETE are unchanged, since private preview is correctly treated
like any other live tier.
Documentation is the DECLARE doc string, which the nightly docs job
regenerates, so no .mdx is edited by hand. allow_feature_tier is a server
setting, so SettingsChangesHistory.cpp, which tracks user-level Settings, does
not apply.
Closes ClickHouse#113481
The three-bit `Flags::TIER` mask is the load-bearing part of adding a fourth tier, and nothing in the suite could detect its reversion. With the old two-bit mask, encoding 16 masks to 0 and reads as PRODUCTION, so a private-preview setting would be silently writable at every `allow_feature_tier` level while every test stayed green: the enum reference is built from the enumerators and never calls `getTier`, the per-tier counts are zero under either mask because no setting carries the tier yet, the range check never fires, and the integration test exercises only the pre-existing encodings. `BaseSettingsHelpers::getTier` is a public static taking a raw `UInt64`, so it can be tested directly. The new case asserts that all five encodings round-trip, that the three reachable invalid encodings throw `INCORRECT_DATA`, and that `IMPORTANT`, `CUSTOM` and `HOT_RELOAD` do not disturb the tier read. Reverting the mask fails it at exactly the private-preview assertion while the other four encodings still pass. The per-tier rows added to `03257_setting_tiers` now assert `count() == 0` instead of `count() >= 0`. The latter holds for any count, so it could never fail; the former states the current fact that no setting carries the tier and reddens when one joins it without the reference being updated. Also name the new tier in the `getTier` doc comment, the last place in `src` and `programs` that still enumerated only three tiers.
Internal second-model reviewAn independent cold review plus a separate adversarial pass were run against this diff before it Both channels found no code defect. The independent pass reported zero findings after reading The carrier census is the part worth stating, because a missed carrier here fails in the Two claims carry the change, and both were measured rather than argued: ❌ Nothing sets the bit the widened mask newly captures. A parser-based census of the flags ❌ The tier bits never cross the wire.
💡 Changelog category, offered as a maintainer's call. This is filed as 💡 One nit, not blocking. In the Session id: cron:clickhouse-review-slot-52:20260805-211700 |
Pre-PR validation gate (a-i)
Validation. Clean build with Session id: cron:clickhouse-review-slot-52:20260805-211700 |
|
cc @jkartseva @vitlibar, could you review this? It adds a fourth feature tier between experimental and beta, which required widening |
|
Workflow [PR], commit [6bf3fd0] Summary: ✅
AI ReviewSummaryThis PR adds a Final Verdict
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 147/160 (91.88%) · Uncovered code |
CI finish ledger — 6bf3fd0Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
This is the only failure on this head. Fix-presence probe for the owner, by content rather than commit distance: this head's Gates: (a) 175 check-runs, 0 queued/in_progress/pending/waiting; (b) Session id: cron:our-pr-ci-monitor:20260806-050000 |
|
📊 Cloud Performance Report ✅ AI verdict: This is a settings-tier plumbing change: it introduces a new PRIVATE_PREVIEW tier and wires it through access-control gating, sanityCheck signatures, and the system settings/merge_tree_settings enums. None of the changed code runs during query execution, so the flagged improvements on clickbench Q23 (×2.2 faster) and tpch Q7/Q8 (×8.1 and ×2.2 faster) cannot plausibly be caused by this PR — all three have been downgraded to not sure. The large, uniform deltas across unrelated benchmarks (with only 6 source runs and a very noisy Q23) point to measurement/baseline variance rather than a real code effect. clickbenchFlagged queries (1 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_officialFlagged queries (2 of 22)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. Debug info
|
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added a new
private previewfeature tier betweenexperimentalandbeta, so feature tiers are now orderedexperimental < private preview < beta < production. The server settingallow_feature_tiergains a level:0allows all tiers,1excludes experimental,2additionally excludes private preview, and3allows production settings only. Configurations that previously pinnedallow_feature_tier = 2to allow production settings only must now use3. Closes #113481.Description
Adds a fourth maturity tier for features that are on a clear path to general availability but whose applicability is still limited and which are not recommended for production use. Requested in #113481; the numbering below was confirmed by the issue author.
allow_feature_tierbecomes a four-level gate. Only2changes meaning:0still grants everything, and1still grants everything except experimental, because the tier it newly admits contains no setting (this change deliberately moves no existing setting into the new tier).3is new and carries today's2semantics. The single upgrade-visible change is that a server pinned atallow_feature_tier = 2gains beta writability.Flags::TIERwas two bits with all four encodings taken, so it is widened to three (0x0c->0x1c). Every pre-existing encoding decodes identically under the wider mask, and the new tier is appended (= 16) rather than inserted, so no existing value of the user-visiblesystem.settings.tierenum moves. The tier bits are never serialized: the only flags ever written to the wire areIMPORTANTandCUSTOM, so no wire format changes and no protocol-version guard is needed.BaseSettingsHelpers::getTier's range check is the tree's only relational comparison on the enum and is re-keyed to the new maximum; every other consumer tests one specific tier, and all of them gain an explicit branch so the tier is neither silently ungated nor silently unreported.Documentation is the
DECLAREdoc string, which the nightly docs job regenerates; no.mdxis edited by hand.allow_feature_tieris a server setting, soSettingsChangesHistory.cpp(which tracks user-levelSettings) does not apply.Related, no overlap in behaviour: #113156 edits the same two functions in
SettingsConstraints.cppandMergeTreeSettings.cpp, but the two merge cleanly in either order and the mergedsanityCheckcarries both changes, so neither blocks the other.Version info
26.8.1.1490(included in26.8and later)