-
Notifications
You must be signed in to change notification settings - Fork 8.3k
enable_mixed_granularity_parts + delete mutation lead to broken parts #12536
Description
Describe the bug
Imagine that we have a table with old non-adaptive parts (.mrk extension) and enabled mixed granularity in the server's config in section (<enable_mixed_granularity_parts>1<enable_mixed_granularity_parts>) or using ALTER SETTING query.
In this case, when we execute ALTER DELETE mutation (actually use MergedBlockOutputStream) we will take information about index granularity from our source part https://github.com/ClickHouse/ClickHouse/blob/master/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp#L1066-L1067, and mark file extension will be the same as in source part https://github.com/ClickHouse/ClickHouse/blob/master/src/Storages/MergeTree/MergeTreeDataPartWide.cpp#L65 .mrk for the old part. But on the other hand, in the stream settings, we will write index granularity using information from storage https://github.com/ClickHouse/ClickHouse/blob/master/src/Storages/MergeTree/MergedBlockOutputStream.cpp#L49 which will be set to true. So we will get part with .mrk extension and adaptive granularity which server will not be able to read and mark as broken.
Broken since #8290.