You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Adam Hattrell (JIRA)" <ji...@apache.org> on 2016/11/07 14:11:58 UTC

[jira] [Created] (CASSANDRA-12884) Batch logic can lead to unbalanced use of system.batches

Adam Hattrell created CASSANDRA-12884:
-----------------------------------------

             Summary: Batch logic can lead to unbalanced use of system.batches
                 Key: CASSANDRA-12884
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12884
             Project: Cassandra
          Issue Type: Bug
          Components: Core
            Reporter: Adam Hattrell


It looks as though there are some odd edge cases in how we distribute the copies in system.batches.

The main issue is in the filter method for org.apache.cassandra.batchlog.BatchlogManager

{code:java}
 if (validated.size() - validated.get(localRack).size() >= 2)
 {
        // we have enough endpoints in other racks
        validated.removeAll(localRack);
  }

 if (validated.keySet().size() == 1)
 {
       // we have only 1 `other` rack
       Collection otherRack = Iterables.getOnlyElement(validated.asMap().values());
       
        return Lists.newArrayList(Iterables.limit(otherRack, 2));
 }
{code}

So with one or two racks we just return the first 2 entries in the list.  There's no shuffle or randomisation here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)