Skip to content

Upgrade check: tolerate removed experimental text-index setting on attach - #110865

Closed
groeneai wants to merge 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/upgrade-check-tolerate-text-index-positions-setting
Closed

groeneai wants to merge 2 commits into
ClickHouse:masterfrom
groeneai:groeneai/upgrade-check-tolerate-text-index-positions-setting

Conversation

@groeneai

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

#109900 renamed the experimental MergeTree setting allow_experimental_text_index_positions to allow_experimental_text_index_phrase_search (and the text-index argument positions to support_phrase_search) without a compatibility alias. A table written by an older server references the removed setting, so the newer server rejects it on ATTACH and the Upgrade check (amd_release) reports an error-level message:

Code: 115. DB::Exception: Unknown setting 'allow_experimental_text_index_positions': for storage MergeTree: Cannot attach table `test_5`.`tab` ... INDEX idx (message) TYPE text(tokenizer = splitByNonAlpha, positions = 1) ... SETTINGS allow_experimental_text_index_positions = 1 ... (UNKNOWN_SETTING)

This is a master-wide flaky upgrade-compatibility failure that hit several unrelated PRs, e.g. #110615, #108950, #100394 (none touching text indexes).

An engine-side compatibility alias was proposed in #110787 and declined by the text-index feature owner: both the setting and the positions argument were experimental (subject to change at any time, no production usage expected), so no compat is warranted in the engine.

Given that, the fix belongs in the upgrade check: allow-list the exact legacy setting name in the upgrade error grep, mirroring the existing Unknown tokenizer: 'unicode_word' entry that already handles the sibling text-index tokenizer rename from the same feature. Narrowed to the exact name so genuinely unknown settings are not masked.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110615&sha=cd3230f13038705339c3080112f4877341d1a7ad&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

…tach

PR ClickHouse#109900 renamed the experimental MergeTree setting
allow_experimental_text_index_positions to
allow_experimental_text_index_phrase_search (and the text-index argument
positions to support_phrase_search) without a compatibility alias. Both
were experimental, so the feature owner declined an engine-side alias
(see ClickHouse#110787). A table written by an older server references the removed
setting, so the newer server rejects it on attach and the upgrade check
reports an error-level message. This is a master-wide flaky upgrade
failure that hit several unrelated PRs (ClickHouse#110615, ClickHouse#108950, ClickHouse#100394).

Allow-list the exact legacy setting name in the upgrade error grep,
mirroring the existing 'Unknown tokenizer: unicode_word' entry that
handles the sibling text-index tokenizer rename. Narrowed to the exact
name so genuinely unknown settings are not masked.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. An older-server table whose metadata carries SETTINGS allow_experimental_text_index_positions = 1 fails to ATTACH on current master with Unknown setting 'allow_experimental_text_index_positions' (UNKNOWN_SETTING). The upgrade check greps clickhouse-server.upgrade.log for <Error> lines and this one is not allow-listed, so the job fails. Verified the exact log line is now suppressed by the added rg -Fav -e fixed-string pattern.
b Root cause explained? #109900 renamed the experimental MergeTree setting allow_experimental_text_index_positions -> allow_experimental_text_index_phrase_search (and text-index arg positions -> support_phrase_search) with no compat alias. Old metadata references the removed name; the new server rejects it on ATTACH; the upgrade check treats the resulting <Error> line as a failure.
c Fix matches root cause? Yes. The engine-side compat alias was declined by the feature owner (#110787) because the setting/argument are experimental. So the correct place is the upgrade check's error allow-list: tolerate the exact removed experimental setting name across the version boundary, exactly like the sibling Unknown tokenizer: 'unicode_word' entry added for the same feature's tokenizer rename.
d Test intent preserved? Yes. Narrowed to the exact legacy setting name; genuinely unknown settings still fail the check. No test removed or weakened.
e Demonstrated in both directions? The exact CI log line passes through rg -Fav unchanged (not suppressed) without the new pattern and is suppressed with it. bash -n clean.
f Fix general, not a narrow patch? N/A (CI allow-list entry, not a code bug). The sibling positions index-argument error surfaces via the same UNKNOWN_SETTING attach line, which this entry already covers; no separate engine path.
g Generalizes across inputs? N/A (CI allow-list entry, not a code bug).
h Backward compatible? N/A (CI test infra only; no server behavior, on-disk/wire format, or setting default changed).
i Invariants preserved? N/A (CI test infra only).

Session id: cron:clickhouse-worker-slot-2:20260717-134300

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @maxknv @leshikus — could you review? One-line upgrade-check allow-list entry tolerating the removed experimental text-index setting allow_experimental_text_index_positions on attach after upgrade, mirroring the existing unicode_word tokenizer-rename entry. Context / prior engine-side attempt: #110787 (declined by the feature owner as the setting is experimental).

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Jul 17, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b46d5ef]


AI Review

Summary

This PR narrows the upgrade_runner.sh log allow-list to ignore the removed experimental MergeTree setting allow_experimental_text_index_positions during post-upgrade attach. That matches one observed failure mode, but the rename in #109900 also left behind legacy metadata that uses the old text-index argument name without that setting, so the upgrade-check flake is not fully covered yet.

Findings

⚠️ Majors

  • [tests/docker_scripts/upgrade_runner.sh:525] The new allow-list only suppresses the legacy setting-name failure. Old metadata with positions = 0 and no allow_experimental_text_index_positions setting still fails ATTACH with Unexpected text index arguments: positions, because MergeTreeIndexText now accepts only support_phrase_search and throws on leftover options (src/Storages/MergeTree/MergeTreeIndexText.cpp, current lines 2034-2035 and 2080-2081). The previous-release query corpus already creates this shape in 02346_text_index_partially_materialized (current lines 93 and 125), so the same upgrade-check instability can recur when that table is left behind by stress.
Final Verdict

Status: ⚠️ Request changes

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 17, 2026
-e "Key expressions cannot contain subqueries" \
-e "Expression must be deterministic but it contains non-deterministic part" \
-e "Unknown tokenizer: 'unicode_word'" \
-e "Unknown setting 'allow_experimental_text_index_positions'" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allow-list is still incomplete for legacy text-index metadata that used the old argument name without the old MergeTree setting. MergeTreeIndexText only recognizes support_phrase_search, so a table created with positions = 0 now fails ATTACH with Unexpected text index arguments: positions in textIndexCreator / textIndexValidator instead of the filtered Unknown setting 'allow_experimental_text_index_positions' path (src/Storages/MergeTree/MergeTreeIndexText.cpp, current lines 2034-2035 and 2080-2081). The previous-release query corpus already creates that shape in 02346_text_index_partially_materialized (what are now lines 93 and 125 used to be positions = 0 before #109900), so this CI flake can come back as soon as that table survives the stress phase. Please cover the sibling legacy-argument failure too, or accept the old argument on ATTACH.

…n attach

ClickHouse#109900 renamed the text-index argument positions to support_phrase_search
without a compatibility alias. A table written by an older server with
positions = 0/1 in its text index leaves positions unrecognized and fails on
attach with 'Unexpected text index arguments: positions' from
textIndexCreator/textIndexValidator, which is a different code path than the
already-filtered 'Unknown setting' message. The previous-release corpus of
02346_text_index_partially_materialized creates exactly this shape.

Allow-list the exact legacy argument message in the upgrade error grep,
narrowed to the exact name so genuinely unexpected text index arguments are
not masked.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Covered in 9054ec0. Confirmed: ARGUMENT_POSITIONS = "support_phrase_search" (MergeTreeIndexText.cpp:1915), so a legacy positions = 0/1 arg is left unrecognized and both textIndexCreator (:2035) and textIndexValidator (:2081) throw Unexpected text index arguments: positions, a different path than the already-filtered Unknown setting message. The previous-release corpus of 02346_text_index_partially_materialized creates that shape (lines 93/125 were positions = 0 before #109900).

Added -e "Unexpected text index arguments: positions" to the rg -Fav allow-list, narrowed to the exact legacy argument name so genuinely unexpected text index arguments are not masked. Left the argument-accept-on-attach option aside since the setting owner already declined an engine-side alias for the sibling rename (#110787).

@groeneai

groeneai commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this: the failure it suppresses can no longer occur, and adding the entries now would work against the cleanup direction on this file.

The Upgrade check only runs in the PR workflow (ci/workflows/pull_request.py, base_branches=[master]; neither master.py nor release_branches.py schedules it). It installs the highest release strictly below the server version and runs that release's own query corpus (get_previous_release, upgrade_runner.sh:30-38). Master is 26.8.1 since 2026-07-22, so the previous release is now 26.7.x: a live job from today resolved previous_release_tag=v26.7.2.59-stable.

The rename (719cf80, 2026-07-09) is an ancestor of both v26.7.1.1315-stable and v26.7.2.59-stable, and not of v26.6.2.158-stable. So the previous-release binary and corpus both already use allow_experimental_text_index_phrase_search / support_phrase_search: in v26.7.2.59-stable no test file references the legacy setting name, and no text index definition uses a bare positions =. Neither legacy shape can be written across the version boundary any more, and every future previous release (26.7 and later) carries the rename, so this cannot come back.

That matches CIDB. The Unknown setting 'allow_experimental_text_index_positions' line was last seen 2026-07-24 and has 0 occurrences since 2026-07-25; the sibling Unexpected text index arguments line has 0 occurrences in 60 days across the whole table (control: 580 rows matching text index in the same window). The 2026-07-23/24 tail is the short period right after the version bump, before the 26.7.1 release assets were published, when the previous release still resolved to 26.6.x.

There is also a direct precedent pointing the other way from this PR: in 8d8d178 (2026-08-03) @ rschu1ze removed the sibling Unknown tokenizer: 'unicode_word' entry from this same allow-list, fixing that rename in the engine instead. For the positions rename the engine-side alias was deliberately declined (#110787) because the setting and the argument were experimental, and the CI-side suppression that remained is now unnecessary. Rather than resolve 8090 commits of conflict on a shared harness file to add two patterns that match nothing, I am dropping this.

If the legacy shape ever reappears (a jump-version upgrade path, or an older release re-entering the previous-release resolution), the entries are recoverable from 9054ec0.

@groeneai groeneai closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI pr-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants