tikv / pd

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

PD can't balance region after scaling out TiKV #8285

Closed wjhuang2016 closed 3 months ago

wjhuang2016 commented 3 months ago

Bug Report

What did you do?

TiKV kept OOM because of too many regions. Then I scaled out TiKV from 3 to 6. But the PD can't balance the region.

What did you expect to see?

PD can balance the region.

What did you see instead?

What version of PD are you using (pd-server -V)?

rleungx commented 3 months ago

Is there more background about this issue?

wjhuang2016 commented 3 months ago

Is there more background about this issue?

@HuSharp is looking into it. If you need more information, we can discuss privately since some details are not suitable for the public.

HuSharp commented 3 months ago

empty region will not be balanced, for the case of creating a large number of empty regions, it's better to use scatter.

https://github.com/tikv/pd/blob/50c80407cd57e96a85452dd1601fcb41c1f263cf/pkg/schedule/schedulers/balance_region.go#L151-L156

HuSharp commented 3 months ago

Feel free to reopen this issue :)