Skip to content

Cherry pick #88860 to 25.8: Fix premature TTL column removal causing merge failures and wrong defaults#92258

Merged
robot-ch-test-poll2 merged 22 commits intobackport/25.8/88860from
cherrypick/25.8/88860
Dec 18, 2025
Merged

Cherry pick #88860 to 25.8: Fix premature TTL column removal causing merge failures and wrong defaults#92258
robot-ch-test-poll2 merged 22 commits intobackport/25.8/88860from
cherrypick/25.8/88860

Conversation

@robot-ch-test-poll3
Copy link
Copy Markdown
Contributor

Original pull-request #88860

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

amosbird and others added 21 commits October 21, 2025 21:33
…aults.

When column-level TTLs expired, columns were sometimes removed too early
(before DEFAULT expression evaluation or before merge-time transforms that
expect them to exist). As a result:

- Missing columns were filled with **type defaults** instead of the column’s
  **table-defined DEFAULT** expression.
- Skip index statistics became incorrect because indexes were computed using
  wrong default values.
- Merge algorithms depending on certain columns (e.g. GraphiteMergeTree’s
  `Timestamp`, VersionedCollapsingMergeTree’s `sign`, ReplacingMergeTree’s
  `version`, or AggregatingMergeTree’s state columns) could fail with
  `Not found column ... in block` errors.

Now TTL-expired columns are properly handled.
Fix premature TTL column removal causing merge failures and wrong defaults
@robot-ch-test-poll3 robot-ch-test-poll3 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 pr-bugfix Pull request with bugfix, not backported by default labels Dec 16, 2025
@Felixoid
Copy link
Copy Markdown
Member

@amosbird could you help with the conflict resolution here and in #92259, please? If you'd push it somewhere in your repo, I can push it here and in 25.9 releases

@amosbird
Copy link
Copy Markdown
Collaborator

@amosbird could you help with the conflict resolution here and in #92259, please? If you'd push it somewhere in your repo, I can push it here and in 25.9 releases

Sure. But i don't see any conflict here. What's the process of resolving them? Should i just do the backport by myself and push them to my repo?

@Felixoid
Copy link
Copy Markdown
Member

yeah, I usually do it as follows:

git fetch origin
r=25.8; p=88860; git checkout cherrypick/$r/$p; git merge origin/backport/$r/$p || git mergetool

Then simply push to your fork, I'll push it here

@amosbird
Copy link
Copy Markdown
Collaborator

@Felixoid I’ve prepared cherry-pick branches here:

https://github.com/amosbird/ClickHouse/tree/cherrypick/25.8/88860
https://github.com/amosbird/ClickHouse/tree/cherrypick/25.9/88860

P.S. I noticed that #92259 was closed. Is that because 25.9 is already out of support (older than 3 months)?

@Felixoid
Copy link
Copy Markdown
Member

It will be closed very soon; it's not worth caring about.

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-bugfix Pull request with bugfix, not backported by default 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.

5 participants