cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject cassandra git commit: Fix rare NPE in KeyCacheSerializer
Date Tue, 03 Mar 2015 21:56:34 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 abc4a37d0 -> bef1d0cb0


Fix rare NPE in KeyCacheSerializer

patch by Aleksey Yeschenko; reviewed by Benedict Elliott Smith for
CASSANDRA-8067


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

Branch: refs/heads/cassandra-2.1
Commit: bef1d0cb064faa3641fee31e1584b77ca95c9843
Parents: abc4a37
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Tue Mar 3 13:53:14 2015 -0800
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Tue Mar 3 13:56:18 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                             | 1 +
 src/java/org/apache/cassandra/service/CacheService.java | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/bef1d0cb/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 76c2e10..a90dd48 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.4
+ * Fix rare NPE in KeyCacheSerializer (CASSANDRA-8067)
  * Pick sstables for validation as late as possible inc repairs (CASSANDRA-8366)
  * Fix commitlog getPendingTasks to not increment (CASSANDRA-8856)
  * Fix parallelism adjustment in range and secondary index queries

http://git-wip-us.apache.org/repos/asf/cassandra/blob/bef1d0cb/src/java/org/apache/cassandra/service/CacheService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/CacheService.java b/src/java/org/apache/cassandra/service/CacheService.java
index 1b93c2c..48c0941 100644
--- a/src/java/org/apache/cassandra/service/CacheService.java
+++ b/src/java/org/apache/cassandra/service/CacheService.java
@@ -467,11 +467,14 @@ public class CacheService implements CacheServiceMBean
             RowIndexEntry entry = CacheService.instance.keyCache.get(key);
             if (entry == null)
                 return;
+
+            CFMetaData cfm = Schema.instance.getCFMetaData(key.cfId);
+            if (cfm == null)
+                return; // the table no longer exists.
+
             ByteBufferUtil.writeWithLength(key.key, out);
-            Descriptor desc = key.desc;
-            out.writeInt(desc.generation);
+            out.writeInt(key.desc.generation);
             out.writeBoolean(true);
-            CFMetaData cfm = Schema.instance.getCFMetaData(key.desc.ksname, key.desc.cfname);
             cfm.comparator.rowIndexEntrySerializer().serialize(entry, out);
         }
 


Mime
View raw message