You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2015/03/03 23:00:13 UTC

[1/2] cassandra git commit: Fix rare NPE in KeyCacheSerializer

Repository: cassandra
Updated Branches:
  refs/heads/trunk ab15d8e61 -> b2dfe1be9


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/trunk
Commit: bef1d0cb064faa3641fee31e1584b77ca95c9843
Parents: abc4a37
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Tue Mar 3 13:53:14 2015 -0800
Committer: Aleksey Yeschenko <al...@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);
         }
 


[2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

Posted by al...@apache.org.
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: b2dfe1be96288bd9d15ec40cd3d20deff09ca625
Parents: ab15d8e bef1d0c
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Tue Mar 3 13:58:37 2015 -0800
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Tue Mar 3 13:58:37 2015 -0800

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b2dfe1be/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index d8b222e,a90dd48..cc3658d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,65 -1,5 +1,66 @@@
 +3.0
 + * Add role based access control (CASSANDRA-7653, 8650, 7216, 8760)
 + * Avoid accessing partitioner through StorageProxy (CASSANDRA-8244, 8268)
 + * Upgrade Metrics library and remove depricated metrics (CASSANDRA-5657)
 + * Serializing Row cache alternative, fully off heap (CASSANDRA-7438)
 + * Duplicate rows returned when in clause has repeated values (CASSANDRA-6707)
 + * Make CassandraException unchecked, extend RuntimeException (CASSANDRA-8560)
 + * Support direct buffer decompression for reads (CASSANDRA-8464)
 + * DirectByteBuffer compatible LZ4 methods (CASSANDRA-7039)
 + * Group sstables for anticompaction correctly (CASSANDRA-8578)
 + * Add ReadFailureException to native protocol, respond
 +   immediately when replicas encounter errors while handling
 +   a read request (CASSANDRA-7886)
 + * Switch CommitLogSegment from RandomAccessFile to nio (CASSANDRA-8308)
 + * Allow mixing token and partition key restrictions (CASSANDRA-7016)
 + * Support index key/value entries on map collections (CASSANDRA-8473)
 + * Modernize schema tables (CASSANDRA-8261)
 + * Support for user-defined aggregation functions (CASSANDRA-8053)
 + * Fix NPE in SelectStatement with empty IN values (CASSANDRA-8419)
 + * Refactor SelectStatement, return IN results in natural order instead
 +   of IN value list order and ignore duplicate values in partition key IN restrictions (CASSANDRA-7981)
 + * Support UDTs, tuples, and collections in user-defined
 +   functions (CASSANDRA-7563)
 + * Fix aggregate fn results on empty selection, result column name,
 +   and cqlsh parsing (CASSANDRA-8229)
 + * Mark sstables as repaired after full repair (CASSANDRA-7586)
 + * Extend Descriptor to include a format value and refactor reader/writer
 +   APIs (CASSANDRA-7443)
 + * Integrate JMH for microbenchmarks (CASSANDRA-8151)
 + * Keep sstable levels when bootstrapping (CASSANDRA-7460)
 + * Add Sigar library and perform basic OS settings check on startup (CASSANDRA-7838)
 + * Support for aggregation functions (CASSANDRA-4914)
 + * Remove cassandra-cli (CASSANDRA-7920)
 + * Accept dollar quoted strings in CQL (CASSANDRA-7769)
 + * Make assassinate a first class command (CASSANDRA-7935)
 + * Support IN clause on any partition key column (CASSANDRA-7855)
 + * Support IN clause on any clustering column (CASSANDRA-4762)
 + * Improve compaction logging (CASSANDRA-7818)
 + * Remove YamlFileNetworkTopologySnitch (CASSANDRA-7917)
 + * Do anticompaction in groups (CASSANDRA-6851)
 + * Support user-defined functions (CASSANDRA-7395, 7526, 7562, 7740, 7781, 7929,
 +   7924, 7812, 8063, 7813, 7708)
 + * Permit configurable timestamps with cassandra-stress (CASSANDRA-7416)
 + * Move sstable RandomAccessReader to nio2, which allows using the
 +   FILE_SHARE_DELETE flag on Windows (CASSANDRA-4050)
 + * Remove CQL2 (CASSANDRA-5918)
 + * Add Thrift get_multi_slice call (CASSANDRA-6757)
 + * Optimize fetching multiple cells by name (CASSANDRA-6933)
 + * Allow compilation in java 8 (CASSANDRA-7028)
 + * Make incremental repair default (CASSANDRA-7250)
 + * Enable code coverage thru JaCoCo (CASSANDRA-7226)
 + * Switch external naming of 'column families' to 'tables' (CASSANDRA-4369) 
 + * Shorten SSTable path (CASSANDRA-6962)
 + * Use unsafe mutations for most unit tests (CASSANDRA-6969)
 + * Fix race condition during calculation of pending ranges (CASSANDRA-7390)
 + * Fail on very large batch sizes (CASSANDRA-8011)
 + * Improve concurrency of repair (CASSANDRA-6455, 8208)
 + * Select optimal CRC32 implementation at runtime (CASSANDRA-8614)
 + * Evaluate MurmurHash of Token once per query (CASSANDRA-7096)
 +
 +
  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/b2dfe1be/src/java/org/apache/cassandra/service/CacheService.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/CacheService.java
index e9f853c,48c0941..e7adcb0
--- a/src/java/org/apache/cassandra/service/CacheService.java
+++ b/src/java/org/apache/cassandra/service/CacheService.java
@@@ -415,13 -467,15 +415,15 @@@ public class CacheService implements Ca
              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);
 +            key.desc.getFormat().getIndexSerializer(cfm).serialize(entry, out);
          }
  
          public Future<Pair<KeyCacheKey, RowIndexEntry>> deserialize(DataInputStream input, ColumnFamilyStore cfs) throws IOException