Skip to content

Backport #111589 to 26.7: Add setting analyzer_compatibility_apply_final_to_all_joined_tables - #111978

Merged
fm4v merged 3 commits into
26.7from
backport/26.7/111589
Jul 28, 2026
Merged

fm4v merged 3 commits into
26.7from
backport/26.7/111589

Conversation

@robot-ch-test-poll

@robot-ch-test-poll robot-ch-test-poll commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #111589

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.7.2.28

@robot-ch-test-poll robot-ch-test-poll added the pr-backport Changes, backported to release branch. Do not use manually - automated use only! label Jul 26, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [6221343]

Summary: ⏳

job_name test_name status info comment
Stress test (amd_tsan) FAIL
ThreadSanitizer: data race (STID: 2427-2c05) FAIL cidb

@fm4v

fm4v commented Jul 27, 2026

Copy link
Copy Markdown
Member

@groenai check failed tests, probably "26.8" block in SettingsChangesHistory.cpp should be removed

@fm4v

fm4v commented Jul 27, 2026

Copy link
Copy Markdown
Member

@groeneai check failed tests, probably "26.8" block in SettingsChangesHistory.cpp should be removed

@groeneai

Copy link
Copy Markdown
Collaborator

@fm4v your hypothesis is right, and it explains every failing check on b17829bf5457. I checked all of them.

What happened

src/Core/SettingsChangesHistory.cpp on this branch has a "26.8" block that origin/26.7 does not have - the cherry-pick brought master's newest version block along with the two entries it actually needed:

backport head: 26.8, 26.7, 26.6, 26.5, ...
origin/26.7:       26.7, 26.6, 26.5, ...

Four of the five settings in that block do not exist in the 26.7 tree at all - the only occurrence of each name anywhere under src/ is inside SettingsChangesHistory.cpp itself:

  • unique_key_probe_implementation
  • allow_lossy_numeric_supertype
  • join_runtime_filter_min_probe_rows
  • query_plan_short_circuit_constant_false_join

SettingsImpl::applyCompatibilitySetting walks the history from newest downwards and calls getTier(final_name) for every entry of every version above the requested one; for an unknown name that reaches throwSettingNotFound. So on this build any compatibility value below 26.8 - i.e. every value anyone would ever use - fails:

Code: 115. DB::Exception: Unknown setting 'unique_key_probe_implementation':
in attempt to set the value of setting 'compatibility' to '22.3'. (UNKNOWN_SETTING) (version 26.7.2.1)

Attribution of the failing checks

All 26 [ FAIL ] blocks in Stateless tests (amd_asan_ubsan, distributed plan, parallel) contain that exact error - 26 of 26, nothing else. It is not limited to the tests with compatibility in the name; 02970_visible_width_behavior, 03274_join_algorithm_default, 03773_nullable_sparse_join, 04492_optimize_and_compare_chain_work_budget and others fail purely because they set compatibility to an older version somewhere.

Stress test (amd_tsan) fails for the same reason: the smoke run's second pass passes compatibility='21.1' as a client option, so 00001_select_1 itself returns 115.

All 8 failing integration shards are the same cause one level up. Every integration module that sets <compatibility> in a server config now cannot start its server at all (Timed out while waiting for instance ... to start). There are exactly six such modules in the tree, and all six are red:

module config compatibility
test_allow_feature_tier 24.10
test_compatibility_merge_tree_settings 24.7
test_compatibility_readonly_constrained_setting 25.8
test_settings_from_server 24.11
test_backup_restore_on_cluster (test_different_versions) 24.9
test_plain_rewritable_backward_compatibility 25.6

test_storage_s3::test_file_pruning_with_hive_style_partitioning is also just this - it asserts on an error message while passing settings={'compatibility': '26.5'}, and gets the 115 instead.

So: one cause, zero unrelated failures.

The fix

Drop the whole "26.8" block from src/Core/SettingsChangesHistory.cpp on this branch (lines 42-49 on the current head). The two entries this backport actually needs are already in the right places and should stay:

  • 26.6 - {..., true, false, ...} (the behaviour flip)
  • 26.4 - {..., true, true, ...} (the introduction for older branches)

The third entry, under 26.8 with {false, false}, only makes sense on master and is redundant here anyway.

This matches what the merged 26.6 sibling backport #111987 ended up with: its SettingsChangesHistory.cpp diff is exactly those two entries and no new version block. It is also the general release-branch invariant - the newest block on origin/26.6 is 26.6, on 26.4 it is 26.4, and so on.

One separate thing, independent of the above: the SET enable_analyzer = 1; pin you added to 04627_analyzer_compatibility_final_all_joined_tables.sql in #111991 is not on this branch (the backport predates it). It will not bite in BackportPR, which only runs the two amd_asan_ubsan stateless variants, but ReleaseBranchCI on 26.7 does run amd_llvm_coverage, old analyzer, ..., so the test will fail there deterministically once this merges. Worth folding the pin in here, or backporting #111991 right after. The merged 26.6 backport does not have it either, so 26.6 has the same gap.

I have not pushed anything to your branch. Say the word if you would rather I open a PR against 26.7 with the block removal plus the analyzer pin.

@groeneai

Copy link
Copy Markdown
Collaborator

Correction to the last paragraph of my previous comment - I got the CI scope wrong there, and the practical conclusion flips.

I claimed ReleaseBranchCI on 26.7 runs amd_llvm_coverage, old analyzer, ..., so the missing SET enable_analyzer = 1; pin from #111991 would fail there once this merges. That is wrong. ci/workflows/release_branches.py on origin/26.7 selects functional tests with if "asan" in job.name, which picks up only the two amd_asan_ubsan variants - the same two BackportPR runs. I confirmed it against a real run: ReleaseBranchCI on 26.7 head c11a3693e21a has 4 Stateless tests checks and zero old-analyzer stateless checks. The only old analyzer checks on that branch are Integration tests (amd_asan_ubsan, db disk, old analyzer, N/6), which do not run this test.

Checking every workflow file on origin/26.7, no old-analyzer stateless job exists on any of them: backport_branches.py filters amd_asan_ubsan, release_branches.py filters asan, nightly_coverage.py runs only per_test_coverage batches, and master.py (which does take the full job list) triggers on push: branches: ['master'] only. So the pin is genuinely not needed for 26.7 CI to be green, and the same holds for the merged 26.6 backport.

Everything else in that comment stands - the "26.8" block removal is the fix, and it is the only thing needed here. Sorry for the noise.

@fm4v

fm4v commented Jul 27, 2026

Copy link
Copy Markdown
Member

@groeneai fix it

The automated backport of #111589 to 26.7 imported master's newest
`addSettingsChanges(settings_changes_history, "26.8", {...})` block, which
`origin/26.7` does not have. Four of its five settings do not exist in the 26.7
tree at all, so `SettingsImpl::applyCompatibilitySetting` walks the history
newest-first, calls `getTier()` for every entry above the requested version and
reaches `throwSettingNotFound`, making every `compatibility` value below 26.8
fail with `UNKNOWN_SETTING`.

Only the two entries the backport actually needs are kept: the 26.6 behaviour
flip and the 26.4 introduction. This matches the already-merged 26.6 sibling
backport #111987 byte for byte.

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator

Done: #112103

I could not push to backport/26.7/111589 (I have no write access to this repository), so 112103 is the same backport on a branch of mine, based on 26.7, with the one bad hunk dropped. Merge whichever you prefer and close the other. If you would rather keep this PR, the change is a single deletion here: remove the whole addSettingsChanges(settings_changes_history, "26.8", {...}) block, lines 42-49 of src/Core/SettingsChangesHistory.cpp on b17829bf5457. Nothing else needs to change; the 26.6 and 26.4 entries the backport adds are already correct.

That leaves exactly the shape of your already-merged 26.6 sibling #111987, whose SettingsChangesHistory.cpp diff is byte-for-byte the same two entries with no new version block.

I built it and measured both directions on a debug 26.7.2.1 binary:

compatibility b17829bf5457 (this PR) with the block removed
21.1, 24.7, 24.9, 24.10, 24.11, 25.6, 25.8, 26.4, 26.5, 26.6, 26.7 Code: 115 ... Unknown setting 'unique_key_probe_implementation' 1
26.8 1 n/a, no such block on 26.7

Reverting just that hunk and rebuilding reproduces the failing column; restoring it rebuilds to an identical Build ID, so nothing else moved. 04627_analyzer_compatibility_final_all_joined_tables matches its reference, and the backported setting resolves as intended through compatibility: true for 26.4/26.5, false for 26.6/26.7, default false.

One thing worth flagging: 111589 carries v26.4-must-backport, which with the currently active release branches (25.8, 26.3, 26.5, 26.6, 26.7) expands to 26.5, 26.6 and 26.7. So the 26.5 backport is still to come and will hit exactly the same thing, since the cherry-pick imports whatever master's newest version block happens to be at that moment.

@fm4v

fm4v commented Jul 27, 2026

Copy link
Copy Markdown
Member

Pushed the fix from #112103 onto this branch (fast-forward, same commit f21540f97aa): it removes the stray 26.8 SettingsChangesHistory block that made every compatibility value below 26.8 fail with UNKNOWN_SETTING, keeping only the 26.6 and 26.4 entries the backport needs. See the analysis in #112103 for details.

02995_new_settings_history on the 26.7 branch baselines against v26.6.1
and requires every new setting to appear in system.settings_changes with
a version above 26.6. After removing the stray 26.8 block, the newest
entry for `analyzer_compatibility_apply_final_to_all_joined_tables` was
26.6, so the test flagged the setting as unrecorded. Add a no-op
{false, false} entry under 26.7, mirroring what master records in its
newest (26.8) block. The compatibility resolution is unchanged: the
behavior flip stays under 26.6 and the introduction under 26.4.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111978&sha=f21540f97aa8a61769c55e548baab9409f3d7aa4&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%29
PR: #111978
@fm4v
fm4v merged commit 48e9aa8 into 26.7 Jul 28, 2026
35 of 39 checks passed
@fm4v
fm4v deleted the backport/26.7/111589 branch July 28, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants