When replicas fail, restore the replication factor to 3 by following these rules:
When the number of active replicas is 1
First check whether any node in the availability zone where the source replica resides meets the space requirements. If so, create a replica on a node in that availability zone according to the localization rules; otherwise, create a replica in the other availability zone. At this point, the number of active replicas becomes 2, and the system subsequently restores the replica count to 3 according to the rules described below.
This policy ensures that when the number of active replicas is 1, the data block is preferentially restored to two replicas within the current availability zone. In scenarios where the primary availability zone is unstable with repeated anomalies, this policy ensures that the data block reliability quickly increases to a level of 2 replicas.
When the number of active replicas is 2
If two active replicas are in the same availability zone, you can select either replica as the source. If there is an available node in another availability zone, a replica will be created there according to localization rules. If there is no available node in the other availability zone, an attempt to restore up to 3 replicas within the availability zone of the active replica will not be made.
When two active replicas are located in different availability zones: