cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Eriksson (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-9070) Race in cancelling compactions
Date Tue, 31 Mar 2015 17:21:53 GMT


Marcus Eriksson commented on CASSANDRA-9070:

bq. If CompactionTask is already queued with 'marked' SSTables
I think that would still work (unless I misunderstood you comment) - for background compactions
we queue up BackgroundCompactionTasks and don't actually ask for the compaction task until
the BGTask executes, and any other compactions would start executing and throw CompactionException
since we are paused and release any sstables they have

> Race in cancelling compactions
> ------------------------------
>                 Key: CASSANDRA-9070
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Marcus Eriksson
>            Assignee: Marcus Eriksson
>             Fix For: 2.0.14
>         Attachments: 0001-check-if-we-are-paused-before-starting-compaction.patch
> 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()
> # pause compactions - this makes sure we don't create any new compaction tasks from the
compaction strategies
> # 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:
> # we finish a compaction and create a new CompactionTask from the compaction strategy
> # we pause the compaction strategies to not create any new CompactionTasks
> # we cancel all ongoing compactions
> # The CompactionTask created in #1 above registers itself in CompactionMetrics and misses
that it should be cancelled

This message was sent by Atlassian JIRA

View raw message