Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-12884

Batch logic can lead to unbalanced use of system.batches

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 3.0.15, 3.11.1
    • Legacy/Core
    • None
    • Normal

    Description

      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

       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));
       }
      

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

      Attachments

        1. 0001-CASSANDRA-12884.patch
          5 kB
          Daniel Cranford

        Issue Links

          Activity

            People

              daniel.cranford Daniel Cranford
              ahattrell Adam Hattrell
              Daniel Cranford
              Aleksey Yeschenko
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: