v.21.8Improvement

Cancel Running Merges on DROP PARTITION and TRUNCATE for ReplicatedMergeTree

Cancel already running merges in partition on DROP PARTITION and TRUNCATE for ReplicatedMergeTree. Resolves #17151. #25684 (tavplubix).
Cancel ongoing merges in a partition when executing DROP PARTITION or TRUNCATE operations on ReplicatedMergeTree tables.

Why it matters

This feature addresses the issue where merges already running in a partition continue even after the partition is dropped or truncated in ReplicatedMergeTree tables. By canceling these merges, it ensures that drop and truncate operations complete cleanly and promptly, improving data consistency and resource utilization.

How to use it

This behavior is applied automatically on ReplicatedMergeTree tables when users execute DROP PARTITION or TRUNCATE TABLE ... PARTITION commands. No additional configuration is needed.