cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Hobbs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11609) cassandra won't start with schema complaint that does not appear to be valid
Date Wed, 20 Apr 2016 23:29:25 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-11609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15250937#comment-15250937
] 

Tyler Hobbs commented on CASSANDRA-11609:
-----------------------------------------

The root of the problem was that in the 2.x schema, implicitly frozen types (like nested UDTs)
were not wrapped in {{FrozenType()}}.  Before CASSANDRA-7423, these were still implicitly
frozen, so the 2.x -> 3.x migration correctly converted them.  After 7423 this no longer
happens, so they need to be explicitly converted as part of the schema migration.

Migrations from 2.x -> 3.0.x -> 3.x should be fine without this patch.

I attempted to extend {{LegacySchemaMigratorTest}} to cover this, but unfortunately it doesn't
seem possible to create a table that uses a UDT within the test framework.  So, I think we'll
need to continue to rely on the existing upgrade tests for coverage here.

Patch and pending CI runs:

||branch||testall||dtest||
|[CASSANDRA-11609|https://github.com/thobbs/cassandra/tree/CASSANDRA-11609]|[testall|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-11609-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-11609-dtest]|

[~blerer] would you mind reviewing?

> cassandra won't start with schema complaint that does not appear to be valid
> ----------------------------------------------------------------------------
>
>                 Key: CASSANDRA-11609
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11609
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Russ Hatch
>            Assignee: Tyler Hobbs
>             Fix For: 3.x
>
>
> This was found in the upgrades user_types_test.
> Can also be repro'd with ccm.
> To repro using ccm:
> Create a 1 node cluster on 2.2.x
> Create this schema:
> {noformat}
> create keyspace test2 with replication = {'class':'SimpleStrategy', 'replication_factor':1};
> use test2;
> CREATE TYPE address (
>          street text,
>          city text,
>          zip_code int,
>          phones set<text>
>          );
> CREATE TYPE fullname (
>          irstname text,
>          astname text
>          );
> CREATE TABLE users (
>          d uuid PRIMARY KEY,
>          ame frozen<fullname>,
>          ddresses map<text, frozen<address>>
>          );
> {noformat}
> Upgrade the single node to trunk, attempt to start the node up. Start will fail with
this exception:
> {noformat}
> ERROR [main] 2016-04-19 11:33:19,218 CassandraDaemon.java:704 - Exception encountered
during startup
> org.apache.cassandra.exceptions.InvalidRequestException: Non-frozen UDTs are not allowed
inside collections: map<text, address>
>         at org.apache.cassandra.cql3.CQL3Type$Raw$RawCollection.throwNestedNonFrozenError(CQL3Type.java:686)
~[main/:na]
>         at org.apache.cassandra.cql3.CQL3Type$Raw$RawCollection.prepare(CQL3Type.java:652)
~[main/:na]
>         at org.apache.cassandra.cql3.CQL3Type$Raw$RawCollection.prepareInternal(CQL3Type.java:644)
~[main/:na]
>         at org.apache.cassandra.schema.CQLTypeParser.parse(CQLTypeParser.java:53) ~[main/:na]
>         at org.apache.cassandra.schema.SchemaKeyspace.createColumnFromRow(SchemaKeyspace.java:1022)
~[main/:na]
>         at org.apache.cassandra.schema.SchemaKeyspace.lambda$fetchColumns$12(SchemaKeyspace.java:1006)
~[main/:na]
>         at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_77]
>         at org.apache.cassandra.schema.SchemaKeyspace.fetchColumns(SchemaKeyspace.java:1006)
~[main/:na]
>         at org.apache.cassandra.schema.SchemaKeyspace.fetchTable(SchemaKeyspace.java:960)
~[main/:na]
>         at org.apache.cassandra.schema.SchemaKeyspace.fetchTables(SchemaKeyspace.java:939)
~[main/:na]
>         at org.apache.cassandra.schema.SchemaKeyspace.fetchKeyspace(SchemaKeyspace.java:902)
~[main/:na]
>         at org.apache.cassandra.schema.SchemaKeyspace.fetchKeyspacesWithout(SchemaKeyspace.java:879)
~[main/:na]
>         at org.apache.cassandra.schema.SchemaKeyspace.fetchNonSystemKeyspaces(SchemaKeyspace.java:867)
~[main/:na]
>         at org.apache.cassandra.config.Schema.loadFromDisk(Schema.java:134) ~[main/:na]
>         at org.apache.cassandra.config.Schema.loadFromDisk(Schema.java:124) ~[main/:na]
>         at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:229)
[main/:na]
>         at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:558)
[main/:na]
>         at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:687)
[main/:na]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message