v.24.4Improvement

OPTIMIZE FINAL for ReplicatedMergeTree Enhanced to Wait for Active Merges

OPTIMIZE FINAL for ReplicatedMergeTree now will wait for currently active merges to finish and then reattempt to schedule a final merge. This will put it more in line with ordinary MergeTree behaviour. #62067 (Nikita Taranov).
OPTIMIZE FINAL for ReplicatedMergeTree tables now waits for currently active merges to complete before scheduling a final merge, aligning its behavior with that of MergeTree tables.

Why it matters

This feature ensures that OPTIMIZE FINAL on ReplicatedMergeTree does not start a final merge while other merges are running, preventing merge conflicts and improving stability and predictability during optimization operations.

How to use it

Simply run the OPTIMIZE FINAL command on a ReplicatedMergeTree table as usual. The system will now automatically wait for any active merges to finish before attempting the final merge.