Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A92CC181D9 for ; Wed, 29 Apr 2015 18:04:06 +0000 (UTC) Received: (qmail 44231 invoked by uid 500); 29 Apr 2015 18:04:06 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 44192 invoked by uid 500); 29 Apr 2015 18:04:06 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 44175 invoked by uid 99); 29 Apr 2015 18:04:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 18:04:06 +0000 Date: Wed, 29 Apr 2015 18:04:06 +0000 (UTC) From: "Philip Thompson (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-9070) Race in cancelling compactions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-9070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14519849#comment-14519849 ] Philip Thompson commented on CASSANDRA-9070: -------------------------------------------- [~krummas], is it feasible to add a unit test for this? > Race in cancelling compactions > ------------------------------ > > Key: CASSANDRA-9070 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9070 > Project: Cassandra > Issue Type: Bug > Reporter: Marcus Eriksson > Assignee: Marcus Eriksson > Fix For: 2.0.15 > > 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 (v6.3.4#6332)