The allocation of a new replica (first generated replica) is based on the local priority principle. In an active-active cluster, "local" refers to the availability zone where the data access point resides, rather than the local physical disk. The new replica allocation order is as follows:
-
First replica
-
When enabling the local priority policy, the local availability zone acts as the primary availability zone for data blocks (extent):
- If the local physical disk has sufficient space, the first replica is created on the local physical disk.
- If there is insufficient local physical disk space, the first replica is created on the node with the lowest physical disk utilization within the local availability zone. If no nodes are available in the local availability zone, the first replica is created on the node with the lowest physical disk utilization in another availability zone.
-
When the local priority policy is not enabled, the primary availability zone of the active-active cluster is the primary domain of the data block:
- If there are nodes in the primary availability zone of the cluster that meet the space requirements, the first replica is created on the node with the lowest current physical disk usage in this zone.
- If there are no nodes in the primary availability zone of the cluster that meet the space requirements, the first replica is created on the node with the lowest current physical disk usage in the secondary availability zone.
-
Second replica
- If there are available nodes in the primary availability zone, then the replica count is brought up to 2 within this zone following localization rules. For the allocation principle of the remaining third replica, refer to step 3 below.
- If there are no available nodes in the primary availability zone, allocate up to 3 replicas in the secondary availability zone according to the localization rules to complete the distribution.
-
Third replica
If the replication factor is less than 3, check the status of nodes in the secondary availability zone:
- If there are available nodes, allocate up to 3 replicas in the secondary availability zone according to the localization rules to complete the distribution.
- If no node is available, none will be allocated.