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

Make RangeTombstone.Tracker.isDeleted() faster

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: Duplicate
    • None
    • None
    • 2.0.11

    Description

      During compaction and repairs with many tombstones an exorbitant amount of time is spend in RangeTombstone.Tracker.isDeleted().
      The amount of time spend there can be so big that compactions and repairs look "stalled" and the time remaining time estimated frozen at the same value for days.

      Using visualvm I've been sample profiling the code during execution and both in Compaction as well as during repairs found this. (point in time backtraces attached)

      Looking at the code the problem is obviously the linear scanning:

              public boolean isDeleted(Column column)
              {
                  for (RangeTombstone tombstone : ranges)
                  {
                      if (comparator.compare(column.name(), tombstone.min) >= 0
                          && comparator.compare(column.name(), tombstone.max) <= 0
                          && tombstone.maxTimestamp() >= column.timestamp())
                      {
                          return true;
                      }
                  }
                  return false;
              }
      

      I would like to propose to change this and instead use a sorted list (e.g. RangeTombstoneList) here instead.

      Attachments

        1. cassandra-2.0.11-8547.txt
          4 kB
          Dominic Letz
        2. cassandra-2.1-8547.txt
          4 kB
          Dominic Letz
        3. rangetombstone.tracker.txt
          5 kB
          Dominic Letz
        4. Selection_044.png
          160 kB
          Dominic Letz

        Issue Links

        Activity

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

          People

            dominicletz Dominic Letz Assign to me
            dominicletz Dominic Letz
            Dominic Letz
            Sylvain Lebresne
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment