Skip to content

Cherry pick #113581 to 26.7: Add a "private preview" feature tier between experimental and beta - #115263

Closed
robot-ch-test-poll wants to merge 3 commits into
backport/26.7/113581from
cherrypick/26.7/113581
Closed

robot-ch-test-poll wants to merge 3 commits into
backport/26.7/113581from
cherrypick/26.7/113581

Conversation

@robot-ch-test-poll

Copy link
Copy Markdown
Contributor

Original pull-request #113581

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

groeneai and others added 3 commits August 5, 2026 18:36
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 #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 #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.
…-feature-tier

Add a "private preview" feature tier between experimental and beta
@robot-ch-test-poll robot-ch-test-poll added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request labels Aug 18, 2026
@groeneai

Copy link
Copy Markdown
Collaborator

Measured all three cherry-picks before touching anything. Nothing pushed, no label changed.

The conflicts are positional, not semantic. Per git merge-tree --merge-base=d8392cfb: #115263 (26.7) 1 conflicted file, #115262 (26.6) 4, #115261 (26.5) 6 plus one modify/delete. In every hunk the release side simply lacks unrelated neighbouring code that landed on master after the branch cut: the SettingFieldTimespan tests my new test appends after, a different indentation of the allow_feature_tier doc string, the run_sanity_checks guard around the sanityCheck calls. On 26.5 StorageSystemDocumentation.cpp does not exist yet, hence the modify/delete. Nothing collides with the feature's own logic, so all three are mechanically resolvable.

One thing worth deciding first. #113581 changes what allow_feature_tier = 2 means. Measured on the official builds, same setting on both arms:

  • 26.7.4.54, --allow_feature_tier=2, SET allow_database_glue_catalog=1 -> Code: 164 ... Changes to BETA settings are disabled
  • post-merge master 26.8.1.1609, same query -> accepted (and =3 rejects, as control)

Release maps allow_beta_tier_settings = value <= 1; with the new tier it is value <= 2. So a 26.5/26.6/26.7 server that pins 2 today silently gains beta-setting writability on a patch upgrade. That is intended on master as a new feature, but it is a behaviour change in a stable branch, so you may prefer to drop the backports rather than ship it.

The branch set itself is right: with v26.4-must-backport the floor is 26.4, which has no open release PR, so select_backport_branches returns exactly 26.7/26.6/26.5.

How would you like this handled? I do not push to robot backport branches on my own initiative. If you want the backports, I can push the resolutions onto the cherrypick/* branches or open them from my fork, whichever you prefer. If you would rather not carry the tier remap into 26.5-26.7, closing the three is the simpler answer and I will leave that to you.

@robot-ch-test-poll

Copy link
Copy Markdown
Contributor Author

Dear @nikitamikhaylov, @groeneai, this cherry-pick PR has not been updated for 3d0h12m23s. Please resolve the conflicts to backport #113581, or close this PR if the backport is no longer needed. This PR will be automatically closed after 7 days of inactivity.

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

Dear @nikitamikhaylov, @groeneai, this cherry-pick PR has not been updated for 7d2h7m47s. Closing automatically. If you still want to backport #113581, please resolve the conflicts and reopen this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants