Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(load-balance): update selection strategy for max load disk #916

Merged
merged 2 commits into from
Sep 22, 2021

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Sep 22, 2021

In cluster load balance, we will try to migrate partition from max_node who has the max replica count to min_node, then we would like to pick up a max_load_disk who has the max replica count in max_node.
The old pickup strategy, if different disks hold same replica count, it will chosse the first one.

max_node:                   |               min_node:
ssd1: 2.1, 2.2              |                2.1, 2.2, 2.5
ssd2: 2.3, 2.4              |
ssd3: 2.6                   |
...

Just as the example shows, ssd1 will be choosen. However, 2.1 and 2.2 have already exsited in min_node, so there won't be any partition to be moved.

This pr fixs the problem above. We use get_max_load_disk_set to get a disk set. ssd1 and ssd2 will be included in the set. Then pick_up_move will choose one of them randomly.

@hycdong hycdong changed the title feat(load-balance): update max_load_disk feat(load-balance): update selection strategy for max load disk Sep 22, 2021
@hycdong hycdong merged commit 4cce780 into XiaoMi:master Sep 22, 2021
@hycdong hycdong deleted the load_balance_fix branch September 22, 2021 09:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants