The TSO request may have a high latency after the leader changes
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 783
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 36
Description
## Enhancement Task
If the TSO request fails, it will try to update the members to get the new leader.
https://github.com/tikv/pd/blob/41ec8dced0d363950a6541141109aaf605a6b499/client/tso_dispatcher.go#L403-L416
https://github.com/tikv/pd/blob/41ec8dced0d363950a6541141109aaf605a6b499/client/tso_dispatcher.go#L436
And there is a backoff, which the minimum time is 100ms
https://github.com/tikv/pd/blob/41ec8dced0d363950a6541141109aaf605a6b499/client/pd_service_discovery.go#L532-L556
At the same time, the request can still be put into the channel and wait for handling:
https://github.com/tikv/pd/blob/41ec8dced0d363950a6541141109aaf605a6b499/client/tso_client.go#L528
And the request might be affected by the backoff because we need to wait for the stream to be re-established.
Contributor guide
Assessment
This issue has not been assessed yet.