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

Avoid loops over array backed iterators that call iter.remove()

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.0.13, 2.1.3
    • None

    Description

      I noticed from sampling that sometimes compaction spends almost all of its time in iter.remove() in ColumnFamilyStore.removeDeletedStandard. It turns out that the cf object is using ArrayBackedSortedColumns, so deletes are from an ArrayList. If the majority of your columns are GCable tombstones then this is O(n^2). The data structure should be changed or a copy made to avoid this.

      Attachments

        1. cassandra-2.0-8414-1.txt
          8 kB
          Jimmy Mårdell
        2. cassandra-2.0-8414-2.txt
          13 kB
          Jimmy Mårdell
        3. cassandra-2.0-8414-3.txt
          13 kB
          Benedict Elliott Smith
        4. cassandra-2.0-8414-4.txt
          15 kB
          Jimmy Mårdell
        5. cassandra-2.0-8414-5.txt
          12 kB
          Jimmy Mårdell
        6. cassandra-2.1-8414-5.txt
          12 kB
          Jimmy Mårdell
        7. cassandra-2.1-8414-6.txt
          12 kB
          Jimmy Mårdell

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            yarin Jimmy Mårdell Assign to me
            rlow Richard Low
            Jimmy Mårdell
            Richard Low
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment