cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: fix build - re-add CompactionController.removeDeletedInCache for commit fbb5ec0374e1a5f1b24680f1604b6e9201fb535f restore pre-CASSANDRA-3862 approach to removing expired tombstones during compaction
Date Mon, 02 Jul 2012 15:14:22 GMT
Updated Branches:
  refs/heads/trunk 4f1e5e288 -> 086c06ad7


fix build - re-add CompactionController.removeDeletedInCache for commit fbb5ec0374e1a5f1b24680f1604b6e9201fb535f
restore pre-CASSANDRA-3862 approach to removing expired tombstones during compaction


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

Branch: refs/heads/trunk
Commit: 086c06ad7fb211de6be877c3c1ea2ee4f86c6d7e
Parents: 4f1e5e2
Author: Dave Brosius <dbrosius@apache.org>
Authored: Mon Jul 2 11:13:03 2012 -0400
Committer: Dave Brosius <dbrosius@apache.org>
Committed: Mon Jul 2 11:13:03 2012 -0400

----------------------------------------------------------------------
 .../db/compaction/CompactionController.java        |   19 +++++++++++++-
 1 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/086c06ad/src/java/org/apache/cassandra/db/compaction/CompactionController.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionController.java b/src/java/org/apache/cassandra/db/compaction/CompactionController.java
index 4b42ed4..90fe68d 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionController.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionController.java
@@ -20,17 +20,18 @@ package org.apache.cassandra.db.compaction;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
-import java.util.Set;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.db.ColumnFamily;
 import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.DataTracker;
 import org.apache.cassandra.db.DecoratedKey;
 import org.apache.cassandra.io.sstable.SSTableIdentityIterator;
 import org.apache.cassandra.io.sstable.SSTableReader;
+import org.apache.cassandra.service.CacheService;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.Throttle;
 
@@ -113,6 +114,20 @@ public class CompactionController
         cfs.invalidateCachedRow(key);
     }
 
+    public void removeDeletedInCache(DecoratedKey key)
+    {
+        // For the copying cache, we'd need to re-serialize the updated cachedRow, which
would be racy
+        // vs other updates.  We'll just ignore it instead, since the next update to this
row will invalidate it
+        // anyway, so the odds of a "tombstones consuming memory indefinitely" problem are
minimal.
+        // See https://issues.apache.org/jira/browse/CASSANDRA-3921 for more discussion.
+        if (CacheService.instance.rowCache.isPutCopying())
+            return;
+
+        ColumnFamily cachedRow = cfs.getRawCachedRow(key);
+        if (cachedRow != null)
+            ColumnFamilyStore.removeDeleted(cachedRow, gcBefore);
+    }
+
     /**
      * @return an AbstractCompactedRow implementation to write the merged rows in question.
      *
@@ -141,7 +156,7 @@ public class CompactionController
     {
         return getCompactedRow(Collections.singletonList(row));
     }
-    
+
     public void mayThrottle(long currentBytes)
     {
         throttle.throttle(currentBytes);


Mime
View raw message