Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research more even balancing with unequal failure domains #66

Open
DmitryTravyan opened this issue Nov 9, 2022 · 2 comments
Open

Research more even balancing with unequal failure domains #66

DmitryTravyan opened this issue Nov 9, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@DmitryTravyan
Copy link
Contributor

In the current workflow when in one of failure domains has 2 hosts, and another has 3 hosts instances on them will be distributed equally.

@DmitryTravyan DmitryTravyan added the enhancement New feature or request label Nov 9, 2022
@LomakinaAsya
Copy link
Collaborator

LomakinaAsya commented Nov 10, 2022

currently we have counter, that represents a count of tarantool instances on each tree node, calculated as sum of child node instances. to choose server as place for instance we go through tree by smallest counter. this is the reason why we can get unbalanced tree by instances on leaves. see example:
old_unbalanced_schema

I suggest we use (capacity - counter) with the highest value. the parameter will show the available space for instances.

let's have a look at init step. firstly we need to calculate server (leafe) capacity: capacity_by_server = amount_of_instances / amount_of_servers (amount of leaves) -- maximum amount of instances for each server. another nodes have a capacity equals to sum of children capacity.
init

to put instance we need only tree steps: find server with the highest capacity, put the instance and recalculate capacity.
first_step

result for this example:
result

you can test prototype here

@LomakinaAsya
Copy link
Collaborator

cmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants