TiSpark Reads TiKV Not Leader

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

Original topic: TiSpark 读取 TiKV not leader

| username: L一十二十一

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] V4.0.9
[Reproduction Path] Directly reading TiKV data through TiSpark results in a “not leader” error
[Encountered Issue: Problem Phenomenon and Impact]
[Resource Configuration] Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

TiSpark version is V2.5
If you need more information, please reply promptly.

| username: 数据小黑 | Original post link

The new versions of TiDB and TiSpark have already fixed this issue. It is recommended to upgrade TiSpark to the latest version of 3.X for testing. If the error persists, it is advisable to upgrade TiDB to the latest version.

| username: L一十二十一 | Original post link

The reason for this issue, as I understand it, is the outdated metadata of PD leading to a non-leader state. Are there any other possible reasons?

| username: 数据小黑 | Original post link

What you mentioned is one aspect, and another aspect is the time difference between TiSpark obtaining metadata and reading data, or the caching issue. The new version has fixed this problem.

| username: L一十二十一 | Original post link

Let’s first communicate about upgrading the version of TiSpark and see if this issue still occurs.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.