Skip to content

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

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

robot-ch-test-poll4 wants to merge 3 commits into
backport/26.3/113581from
cherrypick/26.3/113581

Conversation

@robot-ch-test-poll4

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-poll4 robot-ch-test-poll4 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 Sep 2, 2026
@groeneai

groeneai commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

I have opened #117883, which resolves this cherry-pick against 26.3.

It is not a literal cherry-pick. Since #113581 merged, #113156 (on this branch as #117502) removed every tier parameter from MergeTreeSettings::sanityCheck and centralized enforcement in SettingsConstraints::getTierChecker, which is reached for both ordinary and MergeTree settings. Replaying the original diff would restore code that was deleted from both branches, so the tier is added at the new enforcement point instead and the five files that existed only to thread tier booleans through sanityCheck are dropped.

One consequence of the re-floor that may not be obvious: it reaches 26.3 only. The 26.6 and 26.7 cherry-picks (#115262, #115263) were closed on the inactivity timer, and cherry_pick.py still binds a closed cherry-pick and then treats it as discarded (self._backported = True), so the robot will not recreate them. 26.8 was branched after #113581 merged and already carries the tier. As things stand, allow_feature_tier = 2 will therefore mean "beta and production" on 26.3 and 26.8, but "production only" on 26.6 and 26.7.

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

Dear @nikitamikhaylov, @groeneai, this cherry-pick PR has not been updated for 3d0h13m31s. 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.

@groeneai

groeneai commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Correction to my comment above: #117883 was closed. A direct PR to a release branch is not the way to resolve a cherry-pick.

The resolution now lives in #117893, built the way the automation builds it: this branch merged with backport/26.3/113581, conflicts resolved, so its base is backport/26.3/113581. It is mergeable with no conflicts, and the content is the same as what I described above.

If you would rather this PR itself stop conflicting, its head can be fast-forwarded to that same commit. The current head 41453250 is an ancestor of 7bc9f8fb, so no force is needed:

git fetch https://github.com/groeneai/ClickHouse groeneai/cherrypick-26.3-113581-resolved && git push origin FETCH_HEAD:cherrypick/26.3/113581

I hold triage on this repository, so I cannot push that branch myself.

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

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

@groeneai

Copy link
Copy Markdown
Collaborator

The resolution for this cherry-pick still exists: 7bc9f8fb93fbb8cdde761a187816cdbbfaf10314 on my fork (branch groeneai/cherrypick-26.3-113581-resolved), which is this PR's head merged with backport/26.3/113581. It is open as #117893 against that same base.

One thing changed with the close, from reading tests/ci/cherry_pick.py: merging #117893 on its own is no longer enough to reach 26.3. ReleaseBranch.process sets _backported = True for a cherry-pick PR in state closed, receive_prs_for_backport excludes #113581 while it carries pr-backports-created, and reconcile_backport_branches skips a stranded backport/* branch whose cherry-pick PR exists but is not merged. So the backport/26.3/113581 -> 26.3 PR would never be created.

What does finish it, for whoever holds write: push the resolved head onto this PR's branch, then reopen this PR. The push is a plain fast-forward, 41453250 is an ancestor of 7bc9f8fb with behind_by 0:

git fetch https://github.com/groeneai/ClickHouse groeneai/cherrypick-26.3-113581-resolved && git push origin FETCH_HEAD:cherrypick/26.3/113581

With this PR open and clean, check_open_prs removes pr-backports-created from #113581 and the following run merges it and opens the 26.3 backport PR.

I hold triage on this repository (push: false), so I cannot do either step myself. If the 26.3 backport is not wanted any more, I will close #117893 instead.

@maxknv
maxknv deleted the cherrypick/26.3/113581 branch November 13, 2026 13:23
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