Add support to get region from pd in the same data center
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Feature Request
**Is your feature request related to a problem? Please describe:**
In a multi region setup, when performing queries involving several regions, latency to get region metadata from the pd leader located in a different region cumulates. In my scenario, more than 3000 get regions are required, taking 28ms each due to network latency. A query that takes seconds when run on tidb instances located in the same region of the PD leader, takes up to 2 minutes when run against a tidb instance in a different region.
**Describe the feature you'd like:**
I would like to be able to make tidb instances prefer the closest pd follower.
**Describe alternatives you've considered:**
I tried the `pd_enable_follower_handle_region` feature, the average latency is reduced, however this is just balancing across all pd instead of just the ones in the same region.
**Teachability, Documentation, Adoption, Migration Strategy:**
Multi region setups.
Contributor guide
Assessment
This issue has not been assessed yet.