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

RangeTombstoneList becoming bottleneck on tombstone heavy tasks

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Won't Fix
    • 2.1.3
    • Legacy/CQL
    • 2.0.11 / 2.1

    Description

      I would like to propose a change of the data structure used in the RangeTombstoneList to store and insert tombstone ranges to something with at least O(log N) insert in the middle and at near O(1) and start AND end. Here is why:

      When having tombstone heavy work-loads the current implementation of RangeTombstoneList becomes a bottleneck with slice queries.

      Scanning the number of tombstones up to the default maximum (100k) can take up to 3 minutes of how addInternal() scales on insertion of middle and start elements.

      The attached test shows that with 50k deletes from both sides of a range.

      INSERT 1...110000
      flush()
      DELETE 1...50000
      DELETE 110000...60000

      While one direction performs ok (~400ms on my notebook):

      SELECT * FROM timeseries WHERE name = 'a' ORDER BY timestamp DESC LIMIT 1
      

      The other direction underperforms (~7seconds on my notebook)

      SELECT * FROM timeseries WHERE name = 'a' ORDER BY timestamp ASC LIMIT 1
      

      Attachments

        1. cassandra-2.0.11-8546.txt
          34 kB
          Dominic Letz
        2. cassandra-2.1-8546.txt
          43 kB
          Dominic Letz
        3. rangetombstonelist_compaction.png
          159 kB
          Dominic Letz
        4. rangetombstonelist_mutation.png
          127 kB
          Dominic Letz
        5. rangetombstonelist_read.png
          160 kB
          Dominic Letz
        6. tombstone_test.tgz
          554 kB
          Dominic Letz

        Activity

          People

            JoshuaMcKenzie Joshua McKenzie
            dominicletz Dominic Letz
            Joshua McKenzie
            Tom Hobbs
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: