Repository navigation
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.
…te-preview-feature-tier Add a "private preview" feature tier between experimental and beta
This is `cherrypick/26.3/113581` with `backport/26.3/113581` merged into it, which is the resolution `tests/ci/cherry_pick.py` attempts itself before it falls back to a manual cherry-pick PR, so master's merge commit of ClickHouse#113581 stays in the history. The port was asked for by @ nikitamikhaylov via the `v26.2-must-backport` label on that PR. 26.3 was cut long before the feature merged, so the change lands on drifted context and ClickHouse#117729 is `CONFLICTING`. This is deliberately not a replay of ClickHouse#113581's diff. Since that PR merged, "Fix allow_feature_tier for MergeTree settings" (ClickHouse#113156, backported to 26.3 as ClickHouse#117502) removed every tier parameter from `MergeTreeSettings::sanityCheck` and centralized enforcement into `SettingsConstraints::isAnyTierRestricted` and `SettingsConstraints::getTierChecker`, which is reached for both ordinary and MergeTree settings. Replaying the original diff would restore code that was deleted from both branches. Instead the tier is expressed in the architecture 26.3 now has: `getTierChecker` gains a `PRIVATE_PREVIEW` branch and `isAnyTierRestricted` its third disjunct, and five files of ClickHouse#113581 that existed only to thread tier booleans through `sanityCheck` are dropped (`programs/server/Server.cpp`, `src/Storages/MergeTree/MergeTreeData.cpp`, `src/Storages/MergeTree/MergeTreeSettings.h`, `src/Storages/MergeTree/MergeTreeSettings.cpp`, `src/Storages/ProjectionsDescription.cpp`). A sixth, `src/Storages/System/StorageSystemDocumentation.cpp`, does not exist on this branch. The encoding change is the same as on master: `PRIVATE_PREVIEW` takes `0b10000`, so `Flags::TIER` widens from `0x0c` to `0x1c` and the `BaseSettingsHelpers::getTier` range bound moves from `BETA` to `PRIVATE_PREVIEW`. Bit `0x10` is free on 26.3, whose only other flags are `IMPORTANT` and `CUSTOM`. Mask and bound move together: widening one without the other either silently reinterprets encodings 20, 24 and 28 or is a no-op. As on master, this changes what `allow_feature_tier = 2` means. It stops being "production settings only" and starts allowing `BETA` settings; the new `3` is production-only. @ nikitamikhaylov specified that mapping and waived compatibility on issue ClickHouse#113481. Two adaptations are branch-local rather than ported verbatim. 26.3 has no `BETA`-tier MergeTree setting, where master has two, so `03257_setting_tiers.reference` keeps this branch's `0` for that row along with the comment explaining it. And `Flags::HOT_RELOAD` does not exist here, so master's neighbour-flag assertion using it is omitted from the new unit test; the `IMPORTANT` and `CUSTOM` assertions remain, and on this branch those are in fact every other flag bit. `docs/en/operations/system-tables/settings.md` gains the missing tier bullet. ClickHouse#113581 touched no documentation because master generates that page from the `StorageSystemSettings.cpp` doc string inside an autogenerated region; 26.3 still hand-maintains the value list at the old docs path, so without this line the server would report five tiers while its own documentation listed four. Related: ClickHouse#113581 Related: ClickHouse#117729 Related: ClickHouse#117502 Related: ClickHouse#113481
1 task done
Member
|
This PR does not make sense |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the conflict resolution for the robot cherry-pick #117729, done the way
tests/ci/cherry_pick.pydoes it itself:cherrypick/26.3/113581withbackport/26.3/113581merged into it. The base here is therefore the robot'sbackport branch, and master's merge commit of #113581 stays in the history, so
pre_check's--is-ancestorwill see 26.3 as carrying the change.Related: #113581
Related: #117729
Related: #117883
The conflicts all come from #113156 and its 26.3 backport #117502, which removed the
tier parameters from
MergeTreeSettings::sanityCheckand centralized enforcement intoSettingsConstraints::isAnyTierRestrictedandgetTierChecker. 26.3 already has thatshape, so the resolution keeps the two centralized hunks and drops the five
sanityCheckplumbing files of #113581, which no longer have a call site here.StorageSystemDocumentation.cppdoes not exist on this branch.Two further resolutions are branch properties rather than choices: 26.3 has no
BETA-tier MergeTree setting, so
03257_setting_tiers.referencekeeps0at thatposition, and
Flags::HOT_RELOADdoes not exist here, so the assertion using it isomitted from the added unit test. The full reasoning is in the commit message.
Validated on 26.3 in both directions:
02117_show_create_table_systemfails on thepristine branch and passes on the resolved tree; the added
SettingsTierunit testpasses and does not compile against pristine sources;
test_allow_feature_tieris21/21; and
allow_feature_tier = 3round-trips on the resolved tree while collapsingto
2on pristine.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added a
private previewfeature tier betweenexperimentalandbeta.allow_feature_tier = 1allows private preview, beta and production settings to be changed,allow_feature_tier = 2allows beta and production settings, and the newallow_feature_tier = 3allows production settings only.Documentation entry for user-facing changes