cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tommy Stendahl (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-11139) New token allocator is broken
Date Tue, 09 Feb 2016 12:43:18 GMT
Tommy Stendahl created CASSANDRA-11139:

             Summary: New token allocator is broken
                 Key: CASSANDRA-11139
             Project: Cassandra
          Issue Type: Bug
            Reporter: Tommy Stendahl

It looks like the logic in the if statment in {{TokenAllocation.getStrategy()}} is broken.
if (replicas >= racks)
else if (racks == 1)
    throw new ConfigurationException(String.format("Token allocation failed: the number of
racks %d in datacenter %s is lower than its replication factor %d.", racks, dc, replicas));
I think the first if statment should be {{(replicas <= racks)}}, otherwise this will be
true if we have fewer racks then replicas and I guess that should result in an exception.

Also the {{if}} and the {{else if}} blocks should change place, it should be
if (racks == 1)
else if (replicas <= racks)
If {{replicas==1}} and {{racks==1}} I think you want the {{StrategyAdapter}} from {{(racks==1)}}.

This message was sent by Atlassian JIRA

View raw message