Questions about DR-AutoSync

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 关于 DR-AutoSync 的疑问

| username: MrSylar

Documentation link:
Single Region Dual AZ Deployment of TiDB | PingCAP Documentation Center

Question:
The structure of DR-AutoSync seems to have iterated many times. I don’t quite understand the current purpose of deploying learner replicas as mentioned in the documentation. It seems that TiFlash doesn’t need to create learner replicas in advance either.

| username: tidb菜鸟一只 | Original post link

A learner cannot be called a leader, nor does it participate in voting; it only synchronizes data but can be manually promoted to a follower.

If there are 3 replicas (including the learner, making it 4 replicas), with two voters in the main center and one voter and one learner in the secondary center, when dr-replicas=1, the commit group is set to 3, ensuring data consistency among all voters. When the main center fails, manual intervention is required. At this point, the follower in the secondary center becomes the leader, and the learner can be promoted to a follower. This results in 2 voters in the secondary center, ensuring the majority principle of the Raft protocol and allowing external services to be provided.

If there are 5 replicas (including the learner, making it 6 replicas), with three voters in the main center and two voters and one learner in the secondary center, when dr-replicas=1, the commit group is set to 5, ensuring data consistency among all voters. When the main center fails, manual intervention is required. At this point, one of the followers in the secondary center becomes the leader, and the learner can be promoted to a follower. This results in 3 voters in the secondary center, ensuring the majority principle of the Raft protocol and allowing external services to be provided.

| username: MrSylar | Original post link

Have you seen the current principle documentation of DR-autosync? I’m curious about what its disaster recovery mechanism looks like now.

| username: tidb菜鸟一只 | Original post link

This falls under the commercial version of TiDB. Generally, TiDB wants you to purchase their support services for this kind of thing… That’s how I understood it from watching TiDB course videos…