cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Stupp (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-10434) Problem upgrading to 3.0 with UDA
Date Fri, 02 Oct 2015 12:22:26 GMT

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

Robert Stupp commented on CASSANDRA-10434:
------------------------------------------

Got it working. Currently building a utest for it, which is more complicated as the production
code.

> Problem upgrading to 3.0 with UDA
> ---------------------------------
>
>                 Key: CASSANDRA-10434
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10434
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Sylvain Lebresne
>            Assignee: Robert Stupp
>             Fix For: 3.0.0 rc2
>
>
> Copy-pasting from [~nutbunnies] comment on CASSANDRA-9756:
> {quote}
> 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}}
> {noformat}
> 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]
> {noformat}
> Can be reproduced with:
> {noformat}
> 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
> {noformat}
> {quote}



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

Mime
View raw message