Repository navigation
Fix vertical TTL delete merge failing when the rows TTL reads a column no part stores - #122164
Conversation
In a vertical TTL-delete merge, `TTLDeleteFilterTransform` evaluates the rows TTL before the merge, but only `TTLTransform`, after the merge, fills a column that no source part stores. If the TTL reads such a column and the parts' TTL is not calculated yet (`MODIFY TTL` with `materialize_ttl_after_modify = 0`, or parts attached from before the column existed), the merge failed with `NOT_FOUND_COLUMN_IN_BLOCK` on every retry. `canVerticalTTLDelete` now rejects such a TTL, so the merge goes horizontal and fills the column first. Also explain what `IMergeTreeDataPart::expired_columns` holds. Fixes ClickHouse#121960. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Workflow [PR], commit [d312777] Summary: ✅
AI ReviewSummaryThis PR makes Final Verdict
LLVM Coverage ReportMeasured on commit d312777.
Changed lines: Changed C/C++ lines covered: 12/13 (92.31%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 23 s compile time in total, 7 of them have a recent master baseline. |
Backport #122164 to 26.8: Fix vertical TTL delete merge failing when the rows TTL reads a column no part stores
Backport #122164 to 26.9: Fix vertical TTL delete merge failing when the rows TTL reads a column no part stores
Backport #122164 to 26.10: Fix vertical TTL delete merge failing when the rows TTL reads a column no part stores
Backport #122164 to 26.7: Fix vertical TTL delete merge failing when the rows TTL reads a column no part stores
Backport #122164 to 26.3: Fix vertical TTL delete merge failing when the rows TTL reads a column no part stores
…ling when the rows TTL reads a column no part stores
Closes: #121960
Related: #97332
When a rows TTL reads a column that no source part stores, the merge chooses a vertical TTL delete.
TTLDeleteFilterTransformthen evaluates the TTL on the merge input before anything has filled thecolumn, and the merge fails with
NOT_FOUND_COLUMN_IN_BLOCKon every retry, so the parts never merge.This exists since 26.3, where
vertical_merge_optimize_ttl_deleteis on by default.The case of a column that no source part stores: one added by
ALTER TABLE ... ADD COLUMNwithouta default and never written, and the parts' TTL is not calculated yet (
MODIFY TTLwithmaterialize_ttl_after_modify = 0, or parts attached from before the column existed).Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix merges failing with
NOT_FOUND_COLUMN_IN_BLOCKon every retry when a rows TTL reads a column that no part stores yet.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/122164]
Version info
26.11.1.596-master(included in26.11and later)26.10.2.88,26.9.26.6,26.8.35.4,26.7.38.11,26.3.60.3