Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 应用非双活设计情况下,怎么控制Leader不会切换到同城
【TiDB Usage Environment】Production\Test Environment\POC
【TiDB Version】V5
【Encountered Problem】High availability design issue
【Reproduction Path】What operations were performed that caused the issue
【Problem Phenomenon and Impact】
In a scenario with two data centers in the same city, raft will automatically elect a leader during a leader switch, which may switch to a node in the same city. Since the application is not designed for active-active, how can we control the leader to be elected only in the local data center? Can this be achieved with labels? Thank you.