cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/5] git commit: Invalidate key cache on table drop
Date Wed, 21 May 2014 15:54:38 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk a519c0a6d -> 91741025c


Invalidate key cache on table drop

patch by thobbs; reviewed by slebresne for CASSANDRA-6525


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

Branch: refs/heads/trunk
Commit: ca213ccdc029e74f548115dfbb61c65d221e5e42
Parents: 20e058b
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed May 21 11:44:50 2014 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed May 21 11:44:50 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ca213ccd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index bd0031e..432d688 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -47,6 +47,7 @@
  * Proper null handle for IF with map element access (CASSANDRA-7155)
  * Improve compaction visibility (CASSANDRA-7242)
  * Fix 2ndary index queries with DESC clustering order (CASSANDRA-6950)
+ * Invalid key cache entries on DROP (CASSANDRA-6525)
 Merged from 1.2:
  * Add Cloudstack snitch (CASSANDRA-7147)
  * Update system.peers correctly when relocating tokens (CASSANDRA-7126)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ca213ccd/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 3fac640..709935a 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -37,6 +37,7 @@ import org.cliffc.high_scale_lib.NonBlockingHashMap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.cassandra.cache.KeyCacheKey;
 import org.apache.cassandra.cache.IRowCacheEntry;
 import org.apache.cassandra.cache.RowCacheKey;
 import org.apache.cassandra.cache.RowCacheSentinel;
@@ -339,6 +340,11 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         for (RowCacheKey key : CacheService.instance.rowCache.getKeySet())
             if (key.cfId == metadata.cfId)
                 invalidateCachedRow(key);
+
+        String ksname = keyspace.getName();
+        for (KeyCacheKey key : CacheService.instance.keyCache.getKeySet())
+            if (key.getPathInfo().left.equals(ksname) && key.getPathInfo().right.equals(name))
+                CacheService.instance.keyCache.remove(key);
     }
 
     /**


Mime
View raw message