v.22.10Improvement

Improved Stale Replica Recovery for ReplicatedMergeTree

Improved stale replica recovery process for ReplicatedMergeTree. If a lost replica has some parts which are absent from a healthy replica, but these parts should appear in the future according to the replication queue of the healthy replica, then the lost replica will keep such parts instead of detaching them. #42134 (Alexander Tokmakov).
Improved the stale replica recovery process for ReplicatedMergeTree tables to better handle parts that are missing but expected to appear in the future according to the replication queue.

Why it matters

This feature solves the problem where lost replicas prematurely detach parts that are absent on healthy replicas but are supposed to be replicated soon. By keeping these parts instead of detaching them, the recovery process becomes more efficient and reliable, reducing unnecessary data loss and improving consistency within replicated data sets.

How to use it

This improvement is applied automatically in the ReplicatedMergeTree engine. Users do not need to take any additional steps to enable this feature; it enhances the existing stale replica recovery logic transparently.