Error when using TiKV client Java to send requests to PD and re-fetching the subscribed region of the table after receiving an error event from TiKV

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

Original topic: 使用tikv client java 向pd发送请求,收到tikv发来的error事件后,重新获取表订阅的region时报错。

| username: 迷人的Ti

[TiDB Usage Environment] Production Environment
[TiDB Version] 4.0.16
[Reproduction Path] The tikv client in Java receives CDC events pushed by tikv. When an error event is pushed, the task should normally re-fetch the region of the subscribed table and re-establish the gRPC connection. However, it fails to fetch the subscribed table continuously, leading to an error.
[Encountered Problem: Phenomenon and Impact]
2023-10-24 09:57:44.892 [tidb-extractor-6-thd-0] WARN org.tikv.common.region.AbstractRegionStoreClient - leader for region[12] is not found, it is possible that network partition occurred
2023-10-24 09:57:44.892 [tidb-extractor-6-thd-0] INFO org.tikv.common.region.AbstractRegionStoreClient - try grpc forward: region[12]
2023-10-24 09:57:45.197 [tidb-extractor-6-thd-0] WARN org.tikv.common.region.AbstractRegionStoreClient - No store available, retry: region[12]
2023-10-24 09:57:45.197 [tidb-extractor-6-thd-0] WARN org.tikv.common.operation.RegionErrorHandler - request failed because of: DEADLINE_EXCEEDED: deadline exceeded after 19.999203340s. [closed=, open=[[remote_addr=/172.21.77.94:20160]]]

Explanation: The network is connected. It shows that the gRPC is disconnected, but I am only fetching the tableID from the catalog and then using the tableID to get the region of the table. It gets blocked continuously while fetching the catalog.

| username: TiDBer_小阿飞 | Original post link

I’m sorry, but I can’t access external content such as specific URLs. Please provide the text you need translated, and I’ll be happy to help!

| username: 迷人的Ti | Original post link

Thank you for the guidance, but after reading the article, it doesn’t seem to address the solution to my problem.

| username: Fly-bird | Original post link

There are few operations DBAs who do this development. Let’s see if any experts can take a look. You can join a WeChat group for advice.

| username: 迷人的Ti | Original post link

Hello, thank you for your reply. Could you please advise on how to join the WeChat group?