Repository navigation
Handle part storage type changes in mutations - #126865
Conversation
When the future part of a mutation has a different storage type than the source part (e.g. `Full` vs `Packed`), files cannot be reused by hardlinks, so the mutation must rewrite the whole part: skip the no-op clone fast path, make the `MutationsInterpreter` return all columns, treat the mutation as affecting all columns, rebuild indices and projections, and do not copy `existing_rows_count` from the source part. Also add `isPerFilePartStorage` (storage formats that allow per-file hardlink reuse; currently only `Full`), cleanup of temporary projection parts in `PartMergerWriter::cancel` for shared storages, and fix a typo in a comment. This reduces divergence with downstream forks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [de0922f] Summary: ✅
AI ReviewSummaryPR #126865 makes Missing context / blind spots
Final VerdictStatus: ✅ Approve. No required changes identified. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units290 translation units recompiled, 3120 s compile time in total, 290 of them have a recent master baseline. |
…-only-mutation-space Conflicts in MutateTask.cpp, ReplicatedMergeTreeQueue.cpp and StorageMergeTree.cpp: - mutationRequiresFullPartRewrite, which replaced the shape predicate in rewritesAllPartColumns and splitAndModifyMutationCommands, now uses isPerFilePartStorage (ClickHouse#126865), and splitAndModifyMutationCommands keeps master's future_storage_type condition and getColumnNameInStorage. - processStatisticsChanges takes master's new parameters and rename handling and keeps the bool result and the early return for unchanged statistics. - The !recalculate_ttl_only condition (ClickHouse#125025) moves into requires_full_part_rewrite, which rewrites_all_columns reuses. - The queue keeps both master's source_parts and mutation_source_part. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Make
MutateTaskhandle mutations whose result part has a different part storage type than the source part (e.g.FullvsPacked). Files cannot be reused by hardlinks across storage types, so such a mutation must rewrite the whole part:splitAndModifyMutationCommands, so the per-file rename path is not used;return_all_columnsin theMutationsInterpretersettings and treat the mutation as affecting all columns;is_per_file_compatible_part_storage);existing_rows_countfrom the source part.Also:
isPerFilePartStoragehelper (storage formats with one addressable object per logical file, which allow per-file hardlink reuse; currently equal toisFullPartStorage) and use it in the places that decide about per-file reuse;PartMergerWriter::cancel, which drops temporary projection parts of the merge subtasks for shared storages, and call it from thecancelof the mutation tasks;In public builds mutations keep the storage type of the source part (
future_part->part_formatis copied from the source part), so this changes no observable behavior here; the code path is used by downstream forks that choose the storage type of the mutated part anew. The motivation is to reduce divergence with downstream forks, which causes merge conflicts.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/126865]
Version info
26.11.1.692-master(included in26.11and later)