cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Theroux (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-14539) cql2 insert/update/batch statements don't function unless the keyspace is specified in the statement
Date Fri, 22 Jun 2018 17:18:00 GMT


Michael Theroux commented on CASSANDRA-14539:

Given that there are workarounds I don't think I have a very strong argument to patch a release
that is officially "*critical fixes only",* although it seems it was one of the last critical
fix that introduced this.  **  

Appreciate the time.

> cql2 insert/update/batch statements don't function unless the keyspace is specified in
the statement
> ----------------------------------------------------------------------------------------------------
>                 Key: CASSANDRA-14539
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Michael Theroux
>            Priority: Major
>             Fix For: 2.1.x
>         Attachments: cql2.diff
> If you perform a cql2 insert/update or batch statement without a keyspace, the following
assertion will occur:
> java.lang.AssertionError: null
>  at org.apache.cassandra.config.Schema.getCFMetaData( ~[apache-cassandra-2.1.20.jar:2.1.20]
>  at org.apache.cassandra.cql.Attributes.maybeApplyExpirationDateOverflowPolicy(
>  at org.apache.cassandra.cql.AbstractModification.getTimeToLive(
>  at org.apache.cassandra.cql.UpdateStatement.mutationForKey(
>  at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(
>  at org.apache.cassandra.cql.UpdateStatement.prepareRowMutations(
>  at org.apache.cassandra.cql.QueryProcessor.processStatement(
>  at org.apache.cassandra.cql.QueryProcessor.process( ~[apache-cassandra-2.1.20.jar:2.1.20]
>  at org.apache.cassandra.thrift.CassandraServer.execute_cql_query(
>  at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(
>  at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(
>  at org.apache.thrift.ProcessFunction.process( ~[libthrift-0.9.2.jar:0.9.2]
>  at org.apache.thrift.TBaseProcessor.process( ~[libthrift-0.9.2.jar:0.9.2]
>  at org.apache.cassandra.thrift.CustomTThreadPoolServer$
>  at java.util.concurrent.ThreadPoolExecutor.runWorker( ~[na:1.8.0_151]
>  at java.util.concurrent.ThreadPoolExecutor$ ~[na:1.8.0_151]
> It will fail with:
>     use test;
>     update users set 'test'='\{"d":1529683115340}' where key='c426f519100da4cb24417bc87c5bfbd6'
> But will work fine with:
>     update test.users set 'test'='\{"d":1529683115340}' where key='c426f519100da4cb24417bc87c5bfbd6'
> Going through the code, looks like this was introduced with in
February 2018.
> In org.apache.cassandra.cql.AbstractNotification.getTimeToLive(), and org.apache.cassandra.cql.BatchStatement.getTimeToLive()
> cassandra is using the keyspace associated with the update statement, which is set to
null if its not in the query itself.
> I resolved this myself locally by changing the getTimeToLive() methods to take a default
keyspace, and use that if it is unavailable on the statement.  The fix looked fairly simple. 
I've attached my diff.
> P.S. Yes, I realize that cql2 is deprecated, and no longer supported, however I wanted
to get this regression in if someone else hits it as I was unable to find any other reports
for this issue.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message