cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [1/2] cassandra git commit: Avoid race in cancelling compactions
Date Wed, 01 Apr 2015 12:42:13 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 0ba5f2721 -> 730cc6064


Avoid race in cancelling compactions

Patch by marcuse; reviewed by yukim for CASSANDRA-9070


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2cf4ca3a
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2cf4ca3a
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2cf4ca3a

Branch: refs/heads/cassandra-2.1
Commit: 2cf4ca3a94ff972b422f1be1a2d601d07ff31a12
Parents: 3d0c4e7
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Tue Mar 31 11:05:40 2015 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Wed Apr 1 14:32:47 2015 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                     | 1 +
 src/java/org/apache/cassandra/db/compaction/CompactionTask.java | 3 +++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2cf4ca3a/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1afe6fe..b6b5caf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.14:
+ * Avoid race in cancelling compactions (CASSANDRA-9070)
  * More aggressive check for expired sstables in DTCS (CASSANDRA-8359)
  * Don't set clientMode to true when bulk-loading sstables to avoid
    a NullPointerException (CASSANDRA-8238)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2cf4ca3a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
index 6c6d3a2..9f7c8dd 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
@@ -145,6 +145,9 @@ public class CompactionTask extends AbstractCompactionTask
             collector.beginCompaction(ci);
         try
         {
+            if (!controller.cfs.getCompactionStrategy().isActive)
+                throw new CompactionInterruptedException(ci.getCompactionInfo());
+
             if (!iter.hasNext())
             {
                 // don't mark compacted in the finally block, since if there _is_ nondeleted
data,


Mime
View raw message