Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12785173AB for ; Fri, 29 Jan 2016 15:33:15 +0000 (UTC) Received: (qmail 37290 invoked by uid 500); 29 Jan 2016 15:32:40 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 37261 invoked by uid 500); 29 Jan 2016 15:32:40 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 37244 invoked by uid 99); 29 Jan 2016 15:32:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2016 15:32:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DF2712C1F5C for ; Fri, 29 Jan 2016 15:32:39 +0000 (UTC) Date: Fri, 29 Jan 2016 15:32:39 +0000 (UTC) From: "Sylvain Lebresne (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-11064) Failed aggregate creation breaks server permanently MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-11064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15123599#comment-15123599 ] Sylvain Lebresne commented on CASSANDRA-11064: ---------------------------------------------- I forgot that we do the parsing of custom type literals with {{fromString()}} but in hindsight, I think it's a weakness that custom type values can't be provided as blob literals so that said value can be understood without knowing the type itself. So I think we should add that: we should support blobs for custom types. If we do so, we can use that form when we create our {{INITCOND}} term, which will avoid some pain for drivers. It's also theoretically more efficient than going through strings (that depends a bit on the custom type of course, but for DynamicCompositeType for instance, the string representation is pretty inefficient). If we do that, I don't think we'll depend on any update of the java driver here (not that upgrading the driver is a bad thing per-se). > Failed aggregate creation breaks server permanently > --------------------------------------------------- > > Key: CASSANDRA-11064 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11064 > Project: Cassandra > Issue Type: Bug > Reporter: Olivier Michallat > Assignee: Robert Stupp > > While testing edge cases around aggregates, I tried the following to see if custom types were supported: > {code} > ccm create v321 -v3.2.1 -n3 > ccm updateconf enable_user_defined_functions:true > ccm start > ccm node1 cqlsh > CREATE FUNCTION id(i 'DynamicCompositeType(s => UTF8Type, i => Int32Type)') > RETURNS NULL ON NULL INPUT > RETURNS 'DynamicCompositeType(s => UTF8Type, i => Int32Type)' > LANGUAGE java > AS 'return i;'; > // function created successfully > CREATE AGGREGATE ag() > SFUNC id > STYPE 'DynamicCompositeType(s => UTF8Type, i => Int32Type)' > INITCOND 's@foo:i@32'; > ServerError: {code} > Despite the error, the aggregate appears in system tables: > {code} > select * from system_schema.aggregates; > keyspace_name | aggregate_name | ... > ---------------+----------------+ ... > test | ag | ... > {code} > But you can't drop it, and trying to drop its function produces the server error again: > {code} > DROP AGGREGATE ag; > InvalidRequest: code=2200 [Invalid query] message="Cannot drop non existing aggregate 'test.ag'" > DROP FUNCTION id; > ServerError: > {code} > What's worse, it's now impossible to restart the server: > {code} > ccm stop; ccm start > org.apache.cassandra.exceptions.SyntaxException: Failed parsing CQL term: [s@foo:i@32] reason: SyntaxException line 1:1 no viable alternative at character '@' > at org.apache.cassandra.cql3.CQLFragmentParser.parseAny(CQLFragmentParser.java:48) > at org.apache.cassandra.cql3.Terms.asBytes(Terms.java:51) > at org.apache.cassandra.schema.SchemaKeyspace.createUDAFromRow(SchemaKeyspace.java:1225) > at org.apache.cassandra.schema.SchemaKeyspace.fetchUDAs(SchemaKeyspace.java:1204) > at org.apache.cassandra.schema.SchemaKeyspace.fetchFunctions(SchemaKeyspace.java:1129) > at org.apache.cassandra.schema.SchemaKeyspace.fetchKeyspace(SchemaKeyspace.java:897) > at org.apache.cassandra.schema.SchemaKeyspace.fetchKeyspacesWithout(SchemaKeyspace.java:872) > at org.apache.cassandra.schema.SchemaKeyspace.fetchNonSystemKeyspaces(SchemaKeyspace.java:860) > at org.apache.cassandra.config.Schema.loadFromDisk(Schema.java:125) > at org.apache.cassandra.config.Schema.loadFromDisk(Schema.java:115) > at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:229) > at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:551) > at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:680) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)