Skip to content

Backport #104705 to 26.4: Add defer_partition_pruning_after_final setting to gate the 26.3 FINAL pruning regression - #105026

Merged
fm4v merged 4 commits into
26.4from
backport/26.4/104705
May 17, 2026
Merged

fm4v merged 4 commits into
26.4from
backport/26.4/104705

Conversation

@robot-ch-test-poll2

@robot-ch-test-poll2 robot-ch-test-poll2 commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #104705
Cherry-pick pull-request #105025

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.4.3.26

…etting to gate the 26.3 FINAL pruning regression
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backport Changes, backported to release branch. Do not use manually - automated use only! label May 15, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [e82cf1c]

Summary: ✅

The backport bot copy-pasted the entire `26.5` block from `master` into
the 26.4 cherry-pick of #104705. That block listed ~45 settings that
do not exist in the 26.4 binary (e.g. `optimize_trivial_group_by_limit_query`,
`paimon_target_snapshot_id`, `predicate_statistics_sample_rate`, ...),
so any query carrying `SETTINGS compatibility = '<old>'` walked the
changes history and failed with:

    Code: 115. DB::Exception: Unknown setting
    'optimize_trivial_group_by_limit_query':
    in attempt to set the value of setting 'compatibility' to '24.1'.

The only meaningful entry needed for the backport is
`defer_partition_pruning_after_final` under the `26.3` block, which the
cherry-pick already added; that entry stays. Removing the whole `26.5`
block restores parity with the 26.4 baseline.

CI report: #105026
fm4v added a commit that referenced this pull request May 15, 2026
The cherrypick/26.3/104705 branch was initially pointed at master's merge
commit 1d2ca79 instead of a clean cherry-pick onto 26.3. It therefore
carried ~50 unrelated master commits plus a chaotic SettingsChangesHistory.cpp
that contained master's 26.5 and 26.4 settings blocks plus a duplicate 26.3
block — duplicate blocks would have thrown at startup (LOGICAL_ERROR
"Detected duplicate version"), and the 26.4/26.5 entries referenced settings
that do not exist in the 26.3 binary (e.g. `optimize_trivial_group_by_limit_query`),
so any query with `SETTINGS compatibility = '<old>'` failed with
`Code: 115. UNKNOWN_SETTING`.

This commit moves the tree to a clean cherry-pick of #104705 on top of
backport/26.3/104705. Net contents identical to the original PR:

  src/Core/Settings.cpp                              | +21
  src/Core/SettingsChangesHistory.cpp                | +1
  src/Processors/QueryPlan/ReadFromMergeTree.cpp     | +12 -3
  tests/queries/0_stateless/04229_defer_partition_pruning_after_final.{sql,reference}

Original PR: #104705
Companion 26.4 CI fixup: #105026
fm4v added 2 commits May 16, 2026 10:51
…6.4 block

The 02995_new_settings_history test baseline (`02995_settings_26_3_1.tsv`)
is a v26.3.1 snapshot that does not contain `defer_partition_pruning_after_final`,
so on the 26.4 branch the setting looks newly added. The test then requires
its `system.settings_changes` entry to have `version > 26.3`, but the
cherry-pick had placed it under the `26.3` block, so the test printed:

    PLEASE ADD THE NEW SETTING TO SettingsChangesHistory.cpp:
    defer_partition_pruning_after_final WAS ADDED

Move the entry to the `26.4` block so the version filter matches. Use
`true, true` since the 26.3 binaries shipped the deferred-pruning behavior
(setting = true) silently — there is no `compatibility`-driven value change
between 26.3 and 26.4. The retroactive note about `compatibility = '26.2'`
is preserved in the description for context.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=105026&sha=4cfa08bb2f7a2982a71fd884deaaf1e034d3d5d4&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2%29
…ster

Master has the entry in two places:
  - 26.5 block: `true, true` (placeholder, satisfies the new-settings check
    on master)
  - 26.3 block: `false, true` (the actual semantic change so
    `compatibility = '26.2'` reverts to the pre-regression fast path)

The 26.4 backport must do the same with `26.4` in place of `26.5`:
keep the `false, true` entry in the 26.3 block for compatibility
semantics, and add a `true, true` placeholder in the 26.4 block so
that 02995_new_settings_history accepts the newly-introduced name on
this branch.
@fm4v
fm4v merged commit 686a8ac into 26.4 May 17, 2026
34 checks passed
@fm4v
fm4v deleted the backport/26.4/104705 branch May 17, 2026 11:50
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
The backport bot copy-pasted the entire `26.5` block from `master` into
the 26.4 cherry-pick of ClickHouse#104705. That block listed ~45 settings that
do not exist in the 26.4 binary (e.g. `optimize_trivial_group_by_limit_query`,
`paimon_target_snapshot_id`, `predicate_statistics_sample_rate`, ...),
so any query carrying `SETTINGS compatibility = '<old>'` walked the
changes history and failed with:

    Code: 115. DB::Exception: Unknown setting
    'optimize_trivial_group_by_limit_query':
    in attempt to set the value of setting 'compatibility' to '24.1'.

The only meaningful entry needed for the backport is
`defer_partition_pruning_after_final` under the `26.3` block, which the
cherry-pick already added; that entry stays. Removing the whole `26.5`
block restores parity with the 26.4 baseline.

CI report: ClickHouse#105026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…4705

Backport ClickHouse#104705 to 26.4: Add `defer_partition_pruning_after_final` setting to gate the 26.3 FINAL pruning regression
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