pd
pd copied to clipboard
Support batch processing with the GetRegion stream call
We have encountered several issues related to the GetRegion call and region cache updates, such as #2843 and #8426. At present, a highly feasible solution to alleviate this type of problem is to change GetRegion from a unary gRPC call to a stream call that supports batch processing, which should reduce the CPU pressure on PD in scenarios such as cache expiration and error retries strom.
- [x] Implement the gRPC stream version of
GetRegionwhich supports handling various queries, such asGetPrevRegionandGetRegionByID. - [x] Implement the batch processing logic within the PD client.
- [ ] Integrate the new
GetRegionmethod into the client-go/TiDB. - [ ] Conduct the benchmark tests with the previous version to evaluate the QPS/CPU usage performance.
/cc @JackL9u