cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hust (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-9756) Cleanup UDA code after 6717
Date Thu, 01 Oct 2015 22:09:26 GMT

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

Andrew Hust commented on CASSANDRA-9756:
----------------------------------------

Not sure if this should be a separate ticket but 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}}

{code}
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]
{code}

Can be reproduced with:
{code}
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

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
{code}

//CC [~enigmacurry]

> Cleanup UDA code after 6717
> ---------------------------
>
>                 Key: CASSANDRA-9756
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9756
>             Project: Cassandra
>          Issue Type: Task
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>            Priority: Minor
>             Fix For: 3.x
>
>
> After CASSANDRA-6717 has landed, there should be some cleanup of UDF/UDA code wrt load
from schema tables and handling broken functions.
> /cc [~iamaleksey] 



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

Mime
View raw message