Issues with Placement Rules in SQL

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

Original topic: placement rules in sql的问题

| username: TiDBer_Q6zIfbhF

To ensure that enough follower replicas are placed in the primary region (us-east-1), you can use the MAJORITY_IN_PRIMARY scheduling rule to make the number of followers in that region reach the specified quantity. This scheduling sacrifices some availability in exchange for lower transaction latency. If the primary region goes down, MAJORITY_IN_PRIMARY cannot provide automatic failover.

  1. What does this sentence in the Placement Rules in SQL documentation mean, and how many replicas are considered enough? If there are currently 3 regions and 5 replicas, and you want to deploy the replicas as 3, 1, 1, can you directly configure SCHEDULE=“MAJORITY_IN_PRIMARY”?
  2. If the primary region goes down, MAJORITY_IN_PRIMARY cannot provide automatic failover. Does this mean that if all replicas in the primary region fail, the other regions cannot elect a leader either?
| username: tidb菜鸟一只 | Original post link

  1. The sufficient number of follower replicas is the majority of replicas. Currently, there are 3 regions and 5 replicas. If you want to deploy the replicas as 3, 1, 1, you can directly configure SCHEDULE=“MAJORITY_IN_PRIMARY” to achieve the desired effect.
  2. If the primary region goes down, it means that the majority of your replicas are down. If half or more replicas in MAJORITY_IN_PRIMARY are abnormal, this anomaly may cause TiDB cluster write requests to fail, making the application unusable. Because if half or more replicas in MAJORITY_IN_PRIMARY are unavailable, the TiDB cluster cannot achieve consistency, data cannot be written, and the application cannot perform normal database operations.
| username: TiDBer_Q6zIfbhF | Original post link

Oh, thank you. By “enough follower replicas,” you mean just over half of the replicas, right? For example, if there are 7 replicas, then 4 replicas should be in the primary region; if there are 5 replicas, then 3 replicas should be in the primary region. Is that correct? Currently, there is a requirement for one region of a particular table to have 0 replicas. Can this be configured through SCHEDULE? Is it true that SCHEDULE cannot specify the number of replicas for a particular region?

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

If there are 0 replicas, can’t you just remove it from REGIONS?