cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [02/12] cassandra git commit: Disable autocompaction during drain
Date Thu, 23 Jun 2016 13:18:47 GMT
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/trunk
Commit: 5af5bafc87f3efe0388c003b3923ca3452e1e261
Parents: 5ee6e7b
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Thu May 26 13:27:08 2016 +0200
Committer: Marcus Eriksson <marcuse@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())


Mime
View raw message