You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by "Lei Xia (JIRA)" <ji...@apache.org> on 2016/08/09 22:27:20 UTC

[jira] [Commented] (HELIX-631) AutoRebalanceStrategy does not work correctly all the time

    [ https://issues.apache.org/jira/browse/HELIX-631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15414352#comment-15414352 ] 

Lei Xia commented on HELIX-631:
-------------------------------

Confirmed that this can be reproduced.  The following preference list was generated (with partition 9 missing one replica).

{0=[node-1, node-2, node-3], 
1=[node-4, node-2, node-3], 
10=[node-1, node-4, node-2], 
11=[node-1, node-3, node-2], 
12=[node-4, node-3, node-2], 
13=[node-1, node-4, node-3], 
14=[node-1, node-4, node-2], 
15=[node-1, node-3, node-2], 
2=[node-4, node-1, node-3], 
3=[node-4, node-1, node-2],
 4=[node-3, node-1, node-2], 
5=[node-4, node-3, node-2], 
6=[node-4, node-1, node-3],
7=[node-4, node-1, node-2], 
8=[node-3, node-1, node-2], 
9=[node-4, node-3]}

> 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
>
> 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.4#6332)