Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 从PD中读取到的路由信息中的leader所在的TiKV节点,是否一定是最终读取数据的节点?
【TiDB Usage Environment】Production\Test Environment\POC
【TiDB Version】
【Encountered Problem】
【Reproduction Path】What operations were performed to encounter the problem
【Problem Phenomenon and Impact】
Generally, this is the case, but there can also be exceptions. For example, if the TiKV leader obtained from PD happens to fail, it will trigger a backoff. You will have to wait for a new leader to appear before it can function normally.
It is not necessarily the final node that reads the data. Due to the outdated data cached by the TiDB Server, the leader information obtained by TiDB may be inaccurate. After reaching TiKV, it should still confirm whether the current region is the leader region. By default, data is read on the leader node, but it should also be possible to set it to obtain data on the follower node. For Follower Read, refer to the following document:
Follower Read | PingCAP Docs
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.