pd icon indicating copy to clipboard operation
pd copied to clipboard

Support batch processing with the GetRegion stream call

Open JmPotato opened this issue 1 year ago • 1 comments

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 GetRegion which supports handling various queries, such as GetPrevRegion and GetRegionByID.
  • [x] Implement the batch processing logic within the PD client.
  • [ ] Integrate the new GetRegion method into the client-go/TiDB.
  • [ ] Conduct the benchmark tests with the previous version to evaluate the QPS/CPU usage performance.

JmPotato avatar Oct 11 '24 03:10 JmPotato

/cc @JackL9u

JmPotato avatar Oct 11 '24 03:10 JmPotato