cassandra-commits mailing list archives

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


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.

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( ~[main/:na]
        at org.apache.cassandra.cql3.SingleColumnRelation.newEQRestriction(
        at org.apache.cassandra.cql3.Relation.toRestriction( ~[main/:na]
        at org.apache.cassandra.cql3.restrictions.StatementRestrictions.<init>(
        at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepareRestrictions(
        at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(
        at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(
        at org.apache.cassandra.cql3.QueryProcessor.getStatement(
        at org.apache.cassandra.cql3.QueryProcessor.parseStatement(
        at org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal(
        at org.apache.cassandra.schema.LegacySchemaMigrator.query(
        at org.apache.cassandra.schema.LegacySchemaMigrator.readAggregateMetadata(
        at org.apache.cassandra.schema.LegacySchemaMigrator.readAggregate(
        at org.apache.cassandra.schema.LegacySchemaMigrator.lambda$readAggregates$216(
        at java.lang.Iterable.forEach( ~[na:1.8.0_60]
        at org.apache.cassandra.schema.LegacySchemaMigrator.readAggregates(
        at org.apache.cassandra.schema.LegacySchemaMigrator.readKeyspace(
        at org.apache.cassandra.schema.LegacySchemaMigrator.lambda$readSchema$207(
        at java.util.ArrayList.forEach( ~[na:1.8.0_60]
        at org.apache.cassandra.schema.LegacySchemaMigrator.readSchema(
        at org.apache.cassandra.schema.LegacySchemaMigrator.migrate(
        at org.apache.cassandra.service.CassandraDaemon.setup( [main/:na]
        at org.apache.cassandra.service.CassandraDaemon.activate(
        at org.apache.cassandra.service.CassandraDaemon.main( [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)
            RETURNS int LANGUAGE java AS
            'if (current == null) return candidate; else return Math.max(current, candidate);';
            SFUNC func_1
            STYPE int
            INITCOND null;


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

//CC [~enigmacurry]

> Cleanup UDA code after 6717
> ---------------------------
>                 Key: CASSANDRA-9756
>                 URL:
>             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

View raw message