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

Set instance_weight = 0 in config doesn't mean no partition assigned to the instance #368

Closed
i3wangyi opened this issue Aug 1, 2019 · 0 comments · Fixed by #369
Closed

Comments

@i3wangyi
Copy link
Contributor

i3wangyi commented Aug 1, 2019

Problem
The issue is raised by our internal client who sets the instance_weight = 0 in instance/config. Instead of expecting zero partitions assigned to it, based on our Helix controller algorithm, there's still a good chance some partitions assigned to the instance.

Code of issue
After investigation, the issue was due to the current CardDealingAlgorithm. It treats instance weight as a comparator factor or preference, rather than respecting the weight = 0.

https://github.com/apache/helix/blob/d5bf3ad410e0a54b1e79d9570d3e7897c0e2c947/helix-core/src/main/java/org/apache/helix/controller/rebalancer/strategy/crushMapping/CardDealingAdjustmentAlgorithmV2.java

Solution
There's no way to strictly follow all the weight setting of instances now. Because the algorithm is not designed for the purpose. But for the extreme case of instance weight = 0, the current workaround solution is add a simple check to skip the assignment of the instance.

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

Successfully merging a pull request may close this issue.

1 participant