cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [02/15] git commit: Fix race in background compaction check
Date Wed, 13 Aug 2014 15:34:12 GMT
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 <yukim@apache.org>
Authored: Wed Aug 13 10:27:33 2014 -0500
Committer: Yuki Morishita <yukim@apache.org>
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());
 


Mime
View raw message