v.22.6Improvement

ReplicatedMergeTree Enhancement: Option to Fetch Merged Parts from Lower-Load Replicas

Now if setting always_fetch_merged_part is enabled for ReplicatedMergeTree merges will try to find parts on other replicas rarely with smaller load for [Zoo]Keeper. #37995 (alesapin).
Added the always_fetch_merged_part setting for ReplicatedMergeTree, enabling merge operations to fetch parts from other replicas, reducing load on ZooKeeper.

Why it matters

This feature aims to minimize the load on ZooKeeper during merge operations in ReplicatedMergeTree tables by allowing merges to retrieve parts from other replicas less frequently, thus improving cluster efficiency and reducing potential bottlenecks.

How to use it

Enable the feature by setting always_fetch_merged_part to true in the server or session settings. For example:

SET always_fetch_merged_part = 1;

This will cause merges to attempt fetching parts from other replicas, balancing the load more effectively.