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

Problem upgrading to 3.0 with UDA

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 3.0.0 rc2
    • Component/s: None
    • Labels:
      None
    • Severity:
      Normal

      Description

      Copy-pasting from Andrew Hust comment on CASSANDRA-9756:

      upgrading from 2.2 to 3.0 with a UDA defined will throw the exception below and fail to start when upgraded to 3.0.
      Used:
      2.2: ae9b7e05222b2a25eda5618cf9eb17103e4d6d8b
      3.0: 5c2912d1ce95aacdacb59ccc840b12cd9aa0c8f8

      org.apache.cassandra.exceptions.UnrecognizedEntityException: Undefined name function_name in where clause ('function_name = ?')
              at org.apache.cassandra.cql3.Relation.toColumnDefinition(Relation.java:259) ~[main/:na]
              at org.apache.cassandra.cql3.SingleColumnRelation.newEQRestriction(SingleColumnRelation.java:160) ~[main/:na]
              at org.apache.cassandra.cql3.Relation.toRestriction(Relation.java:137) ~[main/:na]
              at org.apache.cassandra.cql3.restrictions.StatementRestrictions.<init>(StatementRestrictions.java:151) ~[main/:na]
              at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepareRestrictions(SelectStatement.java:817) ~[main/:na]
              at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:764) ~[main/:na]
              at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:752) ~[main/:na]
              at org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:504) ~[main/:na]
              at org.apache.cassandra.cql3.QueryProcessor.parseStatement(QueryProcessor.java:241) ~[main/:na]
              at org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal(QueryProcessor.java:336) ~[main/:na]
              at org.apache.cassandra.schema.LegacySchemaMigrator.query(LegacySchemaMigrator.java:882) ~[main/:na]
              at org.apache.cassandra.schema.LegacySchemaMigrator.readAggregateMetadata(LegacySchemaMigrator.java:849) ~[main/:na]
              at org.apache.cassandra.schema.LegacySchemaMigrator.readAggregate(LegacySchemaMigrator.java:830) ~[main/:na]
              at org.apache.cassandra.schema.LegacySchemaMigrator.lambda$readAggregates$216(LegacySchemaMigrator.java:823) ~[main/:na]
              at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_60]
              at org.apache.cassandra.schema.LegacySchemaMigrator.readAggregates(LegacySchemaMigrator.java:823) ~[main/:na]
              at org.apache.cassandra.schema.LegacySchemaMigrator.readKeyspace(LegacySchemaMigrator.java:166) ~[main/:na]
              at org.apache.cassandra.schema.LegacySchemaMigrator.lambda$readSchema$207(LegacySchemaMigrator.java:154) ~[main/:na]
              at java.util.ArrayList.forEach(ArrayList.java:1249) ~[na:1.8.0_60]
              at org.apache.cassandra.schema.LegacySchemaMigrator.readSchema(LegacySchemaMigrator.java:154) ~[main/:na]
              at org.apache.cassandra.schema.LegacySchemaMigrator.migrate(LegacySchemaMigrator.java:77) ~[main/:na]
              at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:223) [main/:na]
              at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:542) [main/:na]
              at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:668) [main/:na]
      

      Can be reproduced with:

      ccm stop
      ccm remove uda_upgrade
      ccm create -n 1 -v git:cassandra-2.2 uda_upgrade
      ccm updateconf 'enable_user_defined_functions: true'
      ccm start
      
      cat << EOF | ccm node1 cqlsh
      create keyspace ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
      USE ks;
      CREATE FUNCTION func_1(current int, candidate int)
                  CALLED ON NULL INPUT
                  RETURNS int LANGUAGE java AS
                  'if (current == null) return candidate; else return Math.max(current, candidate);';
      CREATE AGGREGATE agg_1(int)
                  SFUNC func_1
                  STYPE int
                  INITCOND null;
      EOF
      
      sleep 10
      
      echo "Draining all nodes"
      ccm node1 nodetool drain
      ccm stop
      
      echo "Upgrading to git:cassandra-3.0"
      ccm setdir -v git:cassandra-3.0
      ccm start
      echo "Sleeping for version migrations"
      sleep 15
      ccm checklogerror
      
      ccm stop
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                snazy Robert Stupp
                Reporter:
                slebresne Sylvain Lebresne
                Authors:
                Robert Stupp
                Reviewers:
                Aleksey Yeschenko
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: