cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [05/15] cassandra git commit: Account for partition deletions in tombstone histogram
Date Thu, 30 Jun 2016 11:19:17 GMT
Account for partition deletions in tombstone histogram

Patch by marcuse; reviewed by Sylvain Lebresne for CASSANDRA-12112


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

Branch: refs/heads/cassandra-3.9
Commit: 5a9820d4a4e3f911a4ec9735bae24261f2652d0f
Parents: cb14186
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Thu Jun 30 10:50:00 2016 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Thu Jun 30 13:12:03 2016 +0200

----------------------------------------------------------------------
 CHANGES.txt                                          |  1 +
 .../cassandra/db/compaction/LazilyCompactedRow.java  |  2 ++
 .../cassandra/db/compaction/CompactionsCQLTest.java  | 15 +++++++++++++++
 3 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a9820d4/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index feeaded..354a1c2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Account for partition deletions in tombstone histogram (CASSANDRA-12112)
  * Avoid stalling paxos when the paxos state expires (CASSANDRA-12043)
  * Remove finished incoming streaming connections from MessagingService (CASSANDRA-11854)
  * Don't try to get sstables for non-repairing column families (CASSANDRA-12077)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a9820d4/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
index 4ca9829..e9aecb2 100644
--- a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
@@ -234,6 +234,8 @@ public class LazilyCompactedRow extends AbstractCompactedRow
             minTimestampTracker.update(maxRowTombstone.isLive() ? Long.MAX_VALUE : maxRowTombstone.markedForDeleteAt);
             maxTimestampTracker.update(maxRowTombstone.markedForDeleteAt);
             maxDeletionTimeTracker.update(maxRowTombstone.isLive() ? Integer.MIN_VALUE :
maxRowTombstone.localDeletionTime);
+            if (!maxRowTombstone.isLive())
+                tombstones.update(maxRowTombstone.localDeletionTime);
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a9820d4/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java b/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
index 4553a45..c8fd781 100644
--- a/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
@@ -26,6 +26,8 @@ import org.apache.cassandra.cql3.CQLTester;
 import org.apache.cassandra.cql3.UntypedResultSet;
 import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.io.sstable.SSTableReader;
+
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -189,6 +191,19 @@ public class CompactionsCQLTest extends CQLTester
 
     }
 
+    @Test
+    public void testTopLevelDeletion() throws Throwable
+    {
+        createTable("CREATE TABLE %s (id int PRIMARY KEY, id2 text)");
+        execute("delete from %s where id = 22");
+        getCurrentColumnFamilyStore().forceBlockingFlush();
+        for (SSTableReader sstable : getCurrentColumnFamilyStore().getSSTables())
+            assertFalse(sstable.getSSTableMetadata().estimatedTombstoneDropTime.getAsMap().isEmpty());
+        getCurrentColumnFamilyStore().forceMajorCompaction();
+        for (SSTableReader sstable : getCurrentColumnFamilyStore().getSSTables())
+            assertFalse(sstable.getSSTableMetadata().estimatedTombstoneDropTime.getAsMap().isEmpty());
+    }
+
 
 
     @Test(expected = IllegalArgumentException.class)


Mime
View raw message