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

Race in cancelling compactions

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 2.0.15
    • Component/s: None
    • Labels:
      None
    • Severity:
      Normal

      Description

      seems we might have a race situation when cancelling compactions

      currently we do the following to ensure that we don't start any new compactions when we try to do markAllCompacting()

      1. pause compactions - this makes sure we don't create any new compaction tasks from the compaction strategies
      2. cancel any ongoing compactions - compactions register themselves with the CompactionMetrics and then, when cancelling we get all compactions here, and tell them to stop

      Problem is that there is a window between when the CompactionTask is created and when it is registered in CompactionMetrics meaning with a bit of bad luck, we could have a situation like this:

      1. we finish a compaction and create a new CompactionTask from the compaction strategy
      2. we pause the compaction strategies to not create any new CompactionTasks
      3. we cancel all ongoing compactions
      4. The CompactionTask created in #1 above registers itself in CompactionMetrics and misses that it should be cancelled

        Attachments

          Activity

            People

            • Assignee:
              marcuse Marcus Eriksson Assign to me
              Reporter:
              marcuse Marcus Eriksson
              Authors:
              Marcus Eriksson
              Reviewers:
              Yuki Morishita

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment