You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2014/01/20 04:38:08 UTC

[1/3] git commit: Improve error message when loaded sstable doesn't match schema

Updated Branches:
  refs/heads/cassandra-2.0 66a8a5575 -> e9a57fbaa


Improve error message when loaded sstable doesn't match schema

patch by slebresne; reviewed by driftx for CASSANDRA-6262


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

Branch: refs/heads/cassandra-2.0
Commit: d3872408d22ae208a5cb9cdf4c1d76370510459d
Parents: 5f63578
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Sun Jan 19 19:24:06 2014 -0800
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Sun Jan 19 19:24:06 2014 -0800

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 .../apache/cassandra/db/marshal/CompositeType.java | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d3872408/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 25c105c..8626b64 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,7 @@
  * Add ability to throttle batchlog replay (CASSANDRA-6550)
  * Fix executing LOCAL_QUORUM with SimpleStrategy (CASSANDRA-6545)
  * Avoid StackOverflow when using large IN queries (CASSANDRA-6567)
+ * Improve error message when schema doesn't match loaded sstable (CASSANDRA-6262)
 
 
 1.2.13

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d3872408/src/java/org/apache/cassandra/db/marshal/CompositeType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/CompositeType.java b/src/java/org/apache/cassandra/db/marshal/CompositeType.java
index 8cb1e34..138a065 100644
--- a/src/java/org/apache/cassandra/db/marshal/CompositeType.java
+++ b/src/java/org/apache/cassandra/db/marshal/CompositeType.java
@@ -86,12 +86,25 @@ public class CompositeType extends AbstractCompositeType
 
     protected AbstractType<?> getComparator(int i, ByteBuffer bb)
     {
-        return types.get(i);
+        try
+        {
+            return types.get(i);
+        }
+        catch (IndexOutOfBoundsException e)
+        {
+            // We shouldn't get there in general because 1) we shouldn't construct broken composites
+            // from CQL and 2) broken composites coming from thrift should be rejected by validate.
+            // There is a few cases however where, if the schema has changed since we created/validated
+            // the composite, this will be thrown (see #6262). Those cases are a user error but
+            // throwing a more meaningful error message to make understanding such error easier. .
+            throw new RuntimeException("Cannot get comparator " + i + " in " + this + ". "
+                                     + "This might due to a mismatch between the schema and the data read", e);
+        }
     }
 
     protected AbstractType<?> getComparator(int i, ByteBuffer bb1, ByteBuffer bb2)
     {
-        return types.get(i);
+        return getComparator(i, bb1);
     }
 
     protected AbstractType<?> getAndAppendComparator(int i, ByteBuffer bb, StringBuilder sb)


[2/3] git commit: Merge branch 'cassandra-1.2' of http://git-wip-us.apache.org/repos/asf/cassandra into cassandra-1.2

Posted by sl...@apache.org.
Merge branch 'cassandra-1.2' of http://git-wip-us.apache.org/repos/asf/cassandra into cassandra-1.2

Conflicts:
	CHANGES.txt


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

Branch: refs/heads/cassandra-2.0
Commit: 3575fdccb7b9dee720c06d133aa5895bf0bb0787
Parents: d387240 9be437b
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Sun Jan 19 19:28:24 2014 -0800
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Sun Jan 19 19:28:24 2014 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  3 +
 conf/cassandra-env.sh                           | 15 ++--
 .../apache/cassandra/db/BatchlogManager.java    | 78 +++++++++++++++----
 .../apache/cassandra/net/MessagingService.java  | 15 +---
 .../cassandra/service/StorageService.java       | 21 ++++-
 .../cassandra/thrift/CustomTHsHaServer.java     |  7 +-
 .../cassandra/db/BatchlogManagerTest.java       | 82 ++++++++++++++++++++
 7 files changed, 178 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3575fdcc/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 8626b64,0b49665..639e17c
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -10,7 -10,9 +10,10 @@@
   * Add ability to throttle batchlog replay (CASSANDRA-6550)
   * Fix executing LOCAL_QUORUM with SimpleStrategy (CASSANDRA-6545)
   * Avoid StackOverflow when using large IN queries (CASSANDRA-6567)
+  * Nodetool upgradesstables includes secondary indexes (CASSANDRA-6589)
+  * Paginate batchlog replay (CASSANDRA-6569)
+  * skip blocking on streaming during drain (CASSANDRA-6603)
 + * Improve error message when schema doesn't match loaded sstable (CASSANDRA-6262)
  
  
  1.2.13


[3/3] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0

Posted by sl...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0


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

Branch: refs/heads/cassandra-2.0
Commit: e9a57fbaa4ae206c818657a5cc8e06d8fc2b6f57
Parents: 66a8a55 3575fdc
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Sun Jan 19 19:35:50 2014 -0800
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Sun Jan 19 19:35:50 2014 -0800

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 .../apache/cassandra/db/marshal/CompositeType.java | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e9a57fba/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index d165c8b,639e17c..b08f04b
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -17,29 -13,10 +17,30 @@@ Merged from 1.2
   * Nodetool upgradesstables includes secondary indexes (CASSANDRA-6589)
   * Paginate batchlog replay (CASSANDRA-6569)
   * skip blocking on streaming during drain (CASSANDRA-6603)
+  * Improve error message when schema doesn't match loaded sstable (CASSANDRA-6262)
  
  
 -1.2.13
 +2.0.4
 + * Allow removing snapshots of no-longer-existing CFs (CASSANDRA-6418)
 + * add StorageService.stopDaemon() (CASSANDRA-4268)
 + * add IRE for invalid CF supplied to get_count (CASSANDRA-5701)
 + * add client encryption support to sstableloader (CASSANDRA-6378)
 + * Fix accept() loop for SSL sockets post-shutdown (CASSANDRA-6468)
 + * Fix size-tiered compaction in LCS L0 (CASSANDRA-6496)
 + * Fix assertion failure in filterColdSSTables (CASSANDRA-6483)
 + * Fix row tombstones in larger-than-memory compactions (CASSANDRA-6008)
 + * Fix cleanup ClassCastException (CASSANDRA-6462)
 + * Reduce gossip memory use by interning VersionedValue strings (CASSANDRA-6410)
 + * Allow specifying datacenters to participate in a repair (CASSANDRA-6218)
 + * Fix divide-by-zero in PCI (CASSANDRA-6403)
 + * Fix setting last compacted key in the wrong level for LCS (CASSANDRA-6284)
 + * Add millisecond precision formats to the timestamp parser (CASSANDRA-6395)
 + * Expose a total memtable size metric for a CF (CASSANDRA-6391)
 + * cqlsh: handle symlinks properly (CASSANDRA-6425)
 + * Fix potential infinite loop when paging query with IN (CASSANDRA-6464)
 + * Fix assertion error in AbstractQueryPager.discardFirst (CASSANDRA-6447)
 + * Fix streaming older SSTable yields unnecessary tombstones (CASSANDRA-6527)
 +Merged from 1.2:
   * Improved error message on bad properties in DDL queries (CASSANDRA-6453)
   * Randomize batchlog candidates selection (CASSANDRA-6481)
   * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e9a57fba/src/java/org/apache/cassandra/db/marshal/CompositeType.java
----------------------------------------------------------------------