Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-12753

Create MV can corrupt C*, blocking all further table actions and startup

    XMLWordPrintableJSON

Details

    • Critical

    Description

      Creating a MV with a protected field name e.g. 'set' results in an error. Post this failed MV create all further actions in the keyspace fail and node startup fails until the keyspace is dropped.

      Tested on a fresh 3.0.9 install single node cluster.

      How to reproduce

      cassandra@cqlsh:test1> CREATE KEYSPACE test1 WITH replication =

      {'class': 'SimpleStrategy', 'replication_factor': 1 }

      AND durable_writes = 'true';
      cassandra@cqlsh:test1> use test1 ;
      cassandra@cqlsh:test1> CREATE TABLE main_table ( field1 text, field2 text, "set" text, PRIMARY KEY ( field1, field2 ) );
      cassandra@cqlsh:test1> CREATE MATERIALIZED VIEW mv1 AS SELECT field2, field1, "set" FROM main_table WHERE field1 IS NOT NULL AND field2 IS NOT NULL PRIMARY KEY ( field2, field1 ) ;
      ServerError: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.cassandra.exceptions.SyntaxException: line 1:23 no viable alternative at input 'set' (SELECT field1, field2, [set]...)

        1. Attached stack traces - 'MV_Create' thrown at this point

      cassandra@cqlsh:test1> drop TABLE main_table ;
      ServerError: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.cassandra.exceptions.SyntaxException: line 1:23 no viable alternative at input 'set' (SELECT field1, field2, [set]...)

        1. Attached stacke traces - 'Table_drop' thrown at this point

      Finally restart Cassandra. Attached stack 'Cass_start' thrown at this point and C* does not start.

      Dropping the keyspace does work, however, this must obviously be done before stopping the node.

      We have also tested this on a 4 node cluster, post the MV create all nodes report the same issue.

      Attachments

        1. Cass_start.txt
          3 kB
          Lin Chen
        2. MV_Create.txt
          14 kB
          Lin Chen
        3. table_drop.txt
          13 kB
          Lin Chen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hazel Lin Chen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: