After Network Card Restart, TiKV Client Reports Error: LoadRegion from PD Failed

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

Original topic: 网卡重启后,tikv客户端报错oadRegion from PD failed

| username: chenbin200818

The screenshot is not visible. Please provide the text you need translated.

| username: chenbin200818 | Original post link

TiKV Usage Environment
  • Testing
TiKV Version
  • Server: v6.5.0
  • Client: client-go: v2.0.0
Reproduction Path
  • Disconnect the network card for several minutes and then restart the network
Encountered Issues
  • After reconnecting the network card, the client fails to send requests (within tens of seconds), with the following error:

    • loadRegion from PD failed, key: “00000000303A00”, rpc error: code = DeadlineExceeded desc = context deadline exceeded
  • After reconnecting the network card, tikv-go-client did not reinitialize

Relevant Code Handling
# Client initialization, using the default initialization method
cli, err := rawkv.NewClient(
# Client request, timeout set to 5 seconds, number of items scanned each time set to 100
ctx, _ := context.WithTimeout(context.Background(), time.Second*5)
keys, values, err := cli.Scan(ctx, startKey, endKey, 100)
Assistance Request
  • How to quickly connect to the server without errors
  • Does client initialization require additional configuration
| username: TiDBer_oHSwKxOH | Original post link

Your question seems like a program issue. Who would mess with the network card for no reason?

| username: chenbin200818 | Original post link

I need to perform tests for abnormal situations and ensure that the program can recover from exceptions.

| username: Kongdom | Original post link

You can check the developer forum to see if any experts have done it :thinking:

| username: redgame | Original post link

Add another daemon to monitor it.