[
https://issues.apache.org/jira/browse/HELIX-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16003275#comment-16003275
]
ASF GitHub Bot commented on HELIX-631:
--------------------------------------
GitHub user dasahcc opened a pull request:
https://github.com/apache/helix/pull/90
[HELIX-631] Fix AutoRebalanceStrategy replica not assigned
In our current AutoRebalanceStrategy, Helix uses greedy algorithm to assign
replicas. With the constraint that two replicas from same partition should not
assigned to same node and nodes' capacity calculated by evenly distributed.
Thus there may some replicas are not assigned.
With this fix, Helix will try to force assign the orphaned replicas to the
node with minimum overload. This may cause imbalanced assignment.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dasahcc/helix helix-0.6.x
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/helix/pull/90.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #90
----
----
> AutoRebalanceStrategy does not work correctly all the time
> ----------------------------------------------------------
>
> Key: HELIX-631
> URL: https://issues.apache.org/jira/browse/HELIX-631
> Project: Apache Helix
> Issue Type: Bug
> Reporter: Subbu
> Assignee: Junkai Xue
> Fix For: 0.6.6
>
>
> I have 16 partitions, 3 replicas each, and 4 instances to distribute these
> on. The auto-rebalancer assigns only 2 replicas for one of the partitions.
> Here is the code snippet to reproduce the problem
> {code}
> final String resourceName = "something";
> final List<String> instanceNames = null; // Initialize to 4 unique strings
> final int nReplicas = 3;
> List<String> partitions = new ArrayList<>(nPartitions);
> for (int i = 0; i < nPartitions; i++) {
> partitions.add(Integer.toString(i));
> }
> LinkedHashMap<String, Integer> states = new LinkedHashMap<>(2);
> states.put("OFFLINE", 0);
> states.put("ONLINE", nReplicas);
> AutoRebalanceStrategy strategy = new AutoRebalanceStrategy(resourceName,
> partitions, states);
> ZNRecord znRecord = strategy.computePartitionAssignment(instanceNames,
> new HashMap<String, Map<String, String>>(0), instanceNames);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)