[
https://issues.apache.org/jira/browse/HELIX-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15963478#comment-15963478
]
Junkai Xue commented on HELIX-631:
----------------------------------
I tried 16 partitions, 6 instances and 3 replicas. It still works.
something, {}{0={NODE_0=ONLINE, NODE_1=ONLINE, NODE_2=ONLINE},
1={NODE_1=ONLINE, NODE_2=ONLINE, NODE_3=ONLINE}, 10={NODE_0=ONLINE,
NODE_4=ONLINE, NODE_5=ONLINE}, 11={NODE_0=ONLINE, NODE_1=ONLINE,
NODE_5=ONLINE}, 12={NODE_0=ONLINE, NODE_1=ONLINE, NODE_2=ONLINE},
13={NODE_1=ONLINE, NODE_2=ONLINE, NODE_3=ONLINE}, 14={NODE_2=ONLINE,
NODE_3=ONLINE, NODE_4=ONLINE}, 15={NODE_3=ONLINE, NODE_4=ONLINE,
NODE_5=ONLINE}, 2={NODE_2=ONLINE, NODE_3=ONLINE, NODE_4=ONLINE},
3={NODE_3=ONLINE, NODE_4=ONLINE, NODE_5=ONLINE}, 4={NODE_0=ONLINE,
NODE_4=ONLINE, NODE_5=ONLINE}, 5={NODE_0=ONLINE, NODE_1=ONLINE, NODE_5=ONLINE},
6={NODE_0=ONLINE, NODE_1=ONLINE, NODE_2=ONLINE}, 7={NODE_1=ONLINE,
NODE_2=ONLINE, NODE_3=ONLINE}, 8={NODE_0=ONLINE, NODE_3=ONLINE, NODE_4=ONLINE},
9={NODE_4=ONLINE, NODE_5=ONLINE}}{0=[NODE_0, NODE_1, NODE_2], 1=[NODE_3,
NODE_1, NODE_2], 10=[NODE_4, NODE_5, NODE_0], 11=[NODE_5, NODE_0, NODE_1],
12=[NODE_2, NODE_0, NODE_1], 13=[NODE_3, NODE_2, NODE_1], 14=[NODE_4, NODE_3,
NODE_2], 15=[NODE_4, NODE_5, NODE_3], 2=[NODE_4, NODE_3, NODE_2], 3=[NODE_5,
NODE_4, NODE_3], 4=[NODE_0, NODE_5, NODE_4], 5=[NODE_0, NODE_1, NODE_5],
6=[NODE_0, NODE_1, NODE_2], 7=[NODE_3, NODE_1, NODE_2], 8=[NODE_4, NODE_3,
NODE_0], 9=[NODE_5, NODE_4]}
> 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)