Repository: cassandra Updated Branches: refs/heads/trunk 9ae7126d3 -> daa3fe611
Fix MarshalException when upgrading super column families patch by slebresne; reviewed by iamaleksey for CASSANDRA-9582 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/172a9754 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/172a9754 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/172a9754 Branch: refs/heads/trunk Commit: 172a9754d62559984b325babd6902ae78c9f6891 Parents: b70f7ea Author: Sylvain Lebresne <[email protected]> Authored: Wed Jul 22 09:46:23 2015 +0200 Committer: Sylvain Lebresne <[email protected]> Committed: Wed Jul 22 09:54:49 2015 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/config/ColumnDefinition.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/172a9754/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 26ee348..0d015db 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.9 + * Fix MarshalException when upgrading superColumn family (CASSANDRA-9582) * Fix broken logging for "empty" flushes in Memtable (CASSANDRA-9837) * Handle corrupt files on startup (CASSANDRA-9686) * Fix clientutil jar and tests (CASSANDRA-9760) http://git-wip-us.apache.org/repos/asf/cassandra/blob/172a9754/src/java/org/apache/cassandra/config/ColumnDefinition.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/config/ColumnDefinition.java b/src/java/org/apache/cassandra/config/ColumnDefinition.java index c447375..51a378c 100644 --- a/src/java/org/apache/cassandra/config/ColumnDefinition.java +++ b/src/java/org/apache/cassandra/config/ColumnDefinition.java @@ -386,10 +386,11 @@ public class ColumnDefinition extends ColumnSpecification : Kind.REGULAR; Integer componentIndex = null; - if (row.has(COMPONENT_INDEX)) - componentIndex = row.getInt(COMPONENT_INDEX); - else if (kind == Kind.CLUSTERING_COLUMN && isSuper) + if (kind == Kind.REGULAR && isSuper) componentIndex = 1; // A ColumnDefinition for super columns applies to the column component + // (we don't trust the COMPONENT_INDEX if we have one due to #9582) + else if (row.has(COMPONENT_INDEX)) + componentIndex = row.getInt(COMPONENT_INDEX); // Note: we save the column name as string, but we should not assume that it is an UTF8 name, we // we need to use the comparator fromString method
