tikv / pd

Placement driver for TiKV
Apache License 2.0
1.04k stars 718 forks source link

Enhance APIs for GetXXXRegions to improve the maintainability #6886

Open AndreMouche opened 1 year ago

AndreMouche commented 1 year ago

Enhancement Task

The GetRegions interface will return all regions of the current system at once. Before, our cluster was relatively small and the number of regions was not high, so it didn't have much impact. When the number of regions grows to a certain magnitude, it will have a significant impact on both memory and CPU for our PD. https://github.com/tikv/pd/blob/0934e641129d8bac3c5975372b2ce492b81fd9db/server/api/region.go#L326-L336 Meanwhile, the monitoring information in this section is very incomplete. For example:

Meanwhile, I think all similar interface have this issue when the number of regions is huge

AndreMouche commented 1 year ago

@nolouch @rleungx Please take a look, thanks!

nolouch commented 1 year ago

👍 make sense