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: Disable single sstable tombstone compactions for DTCS by default
Date Thu, 30 Apr 2015 11:08:09 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 54ea2f244 -> 6770281af


Disable single sstable tombstone compactions for DTCS by default

Patch by marcuse; reviewed by carlyeks for CASSANDRA-9234


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

Branch: refs/heads/cassandra-2.1
Commit: 75e858a66de48a7579fa396ea2e46326c7155f29
Parents: 13af597
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Fri Apr 24 09:35:58 2015 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Thu Apr 30 13:03:14 2015 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                  | 1 +
 .../cassandra/db/compaction/AbstractCompactionStrategy.java  | 3 +++
 .../db/compaction/DateTieredCompactionStrategy.java          | 8 ++++++++
 3 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/75e858a6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 22a9515..8a3e5a9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.15:
+ * Disable single sstable tombstone compactions for DTCS by default (CASSANDRA-9234)
  * Do more agressive ttl expiration checks to be able to
    drop more sstables (CASSANDRA-8243)
  * IncomingTcpConnection thread is not named (CASSANDRA-9262)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/75e858a6/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java
index dc7e43a..30081ca 100644
--- a/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/AbstractCompactionStrategy.java
@@ -64,6 +64,7 @@ public abstract class AbstractCompactionStrategy
     protected float tombstoneThreshold;
     protected long tombstoneCompactionInterval;
     protected boolean uncheckedTombstoneCompaction;
+    protected boolean disableTombstoneCompactions = false;
 
     /**
      * pause/resume/getNextBackgroundTask must synchronize.  This guarantees that after pause
completes,
@@ -288,6 +289,8 @@ public abstract class AbstractCompactionStrategy
      */
     protected boolean worthDroppingTombstones(SSTableReader sstable, int gcBefore)
     {
+        if (disableTombstoneCompactions)
+            return false;
         // since we use estimations to calculate, there is a chance that compaction will
not drop tombstones actually.
         // if that happens we will end up in infinite compaction loop, so first we check
enough if enough time has
         // elapsed since SSTable created.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/75e858a6/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
index cfa9c8a..df28bd4 100644
--- a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
@@ -43,6 +43,14 @@ public class DateTieredCompactionStrategy extends AbstractCompactionStrategy
         super(cfs, options);
         this.estimatedRemainingTasks = 0;
         this.options = new DateTieredCompactionStrategyOptions(options);
+        if (!options.containsKey(AbstractCompactionStrategy.TOMBSTONE_COMPACTION_INTERVAL_OPTION)
&& !options.containsKey(AbstractCompactionStrategy.TOMBSTONE_THRESHOLD_OPTION))
+        {
+            disableTombstoneCompactions = true;
+            logger.debug("Disabling tombstone compactions for DTCS");
+        }
+        else
+            logger.debug("Enabling tombstone compactions for DTCS");
+
     }
 
     @Override


Mime
View raw message