Skip to content

Create load balancing policy: random_prefer_first #4820

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

Closed
nvartolomei opened this issue Mar 27, 2019 · 2 comments · Fixed by #5012
Closed

Create load balancing policy: random_prefer_first #4820

nvartolomei opened this issue Mar 27, 2019 · 2 comments · Fixed by #5012
Labels
easy task Good for first contributors feature

Comments

@nvartolomei
Copy link
Contributor

Use case
For cross-replication topology setups load_balancing=in_order works best as nodes handle equal amount of load and usually they hit only 1/n of data (n = number of replicas), which makes page cache usage more efficient.

The problem is when one node of the shard goes down. If one replica goes down, the next one in config will handle twice the usual load while remaining ones will handle usual traffic.

Describe the solution you'd like

Create a random_prefer_first load balancing policy, so that when all replicas are present load will be spread equally among them, but when one goes down all other replicas will handle 1+1/(n-1) load instead of 1+1.

@alexey-milovidov
Copy link
Member

Prefer first replica in order, and if it is unavailable, loop through all other replicas at random?

@alexey-milovidov alexey-milovidov added the easy task Good for first contributors label Mar 27, 2019
@nvartolomei
Copy link
Contributor Author

@alexey-milovidov sounds like it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy task Good for first contributors feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants