# Two data centers within the same city (C)


![left](./student-guide/diagram/29-Two-center-structure-in-the-same-city-03-01.png)

------------------------------------------------------------

primary-replicas: is the number of voter replicas in the primary datacenter.
dr-replicas is the number of voter replicas from the datacenter.
The wait-store-timeout is the wait time to switch to asynchronous replication mode in the event of network isolation or failure. If there is no recover after this time, it automatically switches to asynchronous replication mode. The default time is 60 seconds.

Switch asynchronously to sync: PD checks TiKV's heartbeat information periodically to determine if the TiKV recover connectivity. If the number of outages is less than the number of PRIMARY/DR's respective replica, it means that synchronization can be switched back. PD switches the cluster replication status to sync-recover first, and then sends the status to all TiKV nodes. All regions of TiKV are gradually switched to dual-room synchronous replication mode. After the switch is successful, the status synchronization information is sent to the PD through a heartbeat. PD records the status of the region on TiKV and counts the recover progress. When all regions of the TiKV are switched to synchronous replication mode, PD switches the cluster replication status to sync.

Disaster recover capabilities:
- Data recover with RPO = 0 is possible in the event of a disaster on a cluster that is in a synchronous replication state:
  - If the primary data center fails, most of the Voter replica are lost, but the data is complete from the data center, the data can be recover from the data center. At this time, manual intervention is required to recover through professional tools.
  - Automatically switch to async asynchronous replication mode in the event of a data center failure and loss of a few Voter replicas.
- In the event of a disaster on a cluster that is not in a synchronous replication state, there is no guarantee that RPO = 0 will be met for data recover:
  - If most replica of Voter are lost, manual intervention is required to recover through professional tools.