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 07DE4111FB for ; Wed, 13 Aug 2014 15:34:12 +0000 (UTC) Received: (qmail 60225 invoked by uid 500); 13 Aug 2014 15:34:11 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 60152 invoked by uid 500); 13 Aug 2014 15:34:11 -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 60023 invoked by uid 99); 13 Aug 2014 15:34:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 15:34:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 580139A5549; Wed, 13 Aug 2014 15:34:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yukim@apache.org To: commits@cassandra.apache.org Date: Wed, 13 Aug 2014 15:34:12 -0000 Message-Id: <748dff378abb4ace8330fcfc1a401b26@git.apache.org> In-Reply-To: <09b1f118f7b44646b735576072d3caf4@git.apache.org> References: <09b1f118f7b44646b735576072d3caf4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/15] git commit: Fix race in background compaction check Fix race in background compaction check patch by yukim; reviewed by krummas for CASSANDRA-7745 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/22a4629d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/22a4629d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/22a4629d Branch: refs/heads/cassandra-2.0 Commit: 22a4629d2569d448f8156dcc384154fcc1571cac Parents: 3fe7028 Author: Yuki Morishita Authored: Wed Aug 13 10:27:33 2014 -0500 Committer: Yuki Morishita Committed: Wed Aug 13 10:27:33 2014 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/db/compaction/CompactionManager.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/22a4629d/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 4c261c9..9fad7c9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,7 @@ * Set correct stream ID on responses when non-Exception Throwables are thrown while handling native protocol messages (CASSANDRA-7470) * Fix row size miscalculation in LazilyCompactedRow (CASSANDRA-7543) + * Fix race in background compaction check (CASSANDRA-7745) 1.2.18 http://git-wip-us.apache.org/repos/asf/cassandra/blob/22a4629d/src/java/org/apache/cassandra/db/compaction/CompactionManager.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java index 471fd82..dd5afc5 100644 --- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java +++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java @@ -167,8 +167,8 @@ public class CompactionManager implements CompactionManagerMBean // we must schedule it at least once, otherwise compaction will stop for a CF until next flush do { - futures.add(executor.submit(new BackgroundCompactionTask(cfs))); compactingCF.add(cfs); + futures.add(executor.submit(new BackgroundCompactionTask(cfs))); // if we have room for more compactions, then fill up executor } while (executor.getActiveCount() + futures.size() < executor.getMaximumPoolSize());