Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 3c8421a33 -> 9358e589e
  refs/heads/cassandra-2.2 225232a9e -> 5d0d30e4d
  refs/heads/cassandra-3.0 5ee6e7bc1 -> ffd6bab35
  refs/heads/trunk 84e40cb6b -> fc7785bfe


Disable autocompaction during drain

Patch by marcuse; reviewed by Alex Petrov for CASSANDRA-11878


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

Branch: refs/heads/cassandra-3.0
Commit: 5af5bafc87f3efe0388c003b3923ca3452e1e261
Parents: 5ee6e7b
Author: Marcus Eriksson <marc...@apache.org>
Authored: Thu May 26 13:27:08 2016 +0200
Committer: Marcus Eriksson <marc...@apache.org>
Committed: Thu Jun 23 13:47:32 2016 +0200

----------------------------------------------------------------------
 CHANGES.txt                                               | 1 +
 src/java/org/apache/cassandra/service/StorageService.java | 6 ++++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5af5bafc/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f7e854d..7db3afb 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.8
+ * Disable autocompaction during drain (CASSANDRA-11878)
  * Add a metrics timer to MemtablePool and use it to track time spent blocked 
on memory in MemtableAllocator (CASSANDRA-11327)
  * Fix upgrading schema with super columns with non-text subcomparators 
(CASSANDRA-12023)
  * Add TimeWindowCompactionStrategy (CASSANDRA-9666)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5af5bafc/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index 394220d..5e14d4f 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -3978,6 +3978,12 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
         StorageProxy.instance.verifyNoHintsInProgress();
 
         setMode(Mode.DRAINING, "flushing column families", false);
+
+        // disable autocompaction - we don't want to start any new compactions 
while we are draining
+        for (Keyspace keyspace : Keyspace.all())
+            for (ColumnFamilyStore cfs : keyspace.getColumnFamilyStores())
+                cfs.disableAutoCompaction();
+
         // count CFs first, since forceFlush could block for the flushWriter 
to get a queue slot empty
         totalCFs = 0;
         for (Keyspace keyspace : Keyspace.nonSystem())

Reply via email to