cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Yeschenko (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-10954) [Regression] Error when removing list element with UPDATE statement
Date Fri, 08 Jan 2016 16:30:39 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-10954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aleksey Yeschenko updated CASSANDRA-10954:
------------------------------------------
    Labels: regression  (was: )

> [Regression] Error when removing list element with UPDATE statement
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-10954
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10954
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local Write-Read Paths
>         Environment: Cassandra 3.0.0, Cassandra 3.1.1
>            Reporter: DOAN DuyHai
>            Assignee: Sylvain Lebresne
>              Labels: regression
>             Fix For: 3.0.x, 3.x
>
>
> Steps to reproduce:
> {code:sql}
> CREATE TABLE simple(
>   id int PRIMARY KEY,
>   int_list list<int>
> );
> INSERT INTO simple(id, int_list) VALUES(10, [1,2,3]);
> SELECT * FROM simple;
>  id | int_list
> ----+-----------
>  10 | [1, 2, 3]
> UPDATE simple SET int_list[0]=null WHERE id=10;
> ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.AssertionError">
> {code}
>  Per CQL semantics, setting a column to NULL == deleting it.
>  When using debugger, below is the Java stack trace on server side:
> {noformat}
>  ERROR o.apache.cassandra.transport.Message - Unexpected exception during request; channel
= [id: 0x6dbc33bd, /192.168.51.1:57723 => /192.168.51.1:9473]
> java.lang.AssertionError: null
> 	at org.apache.cassandra.db.rows.BufferCell.<init>(BufferCell.java:49) ~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.db.rows.BufferCell.tombstone(BufferCell.java:88) ~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.UpdateParameters.addTombstone(UpdateParameters.java:141)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.UpdateParameters.addTombstone(UpdateParameters.java:136)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.Lists$SetterByIndex.execute(Lists.java:362) ~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.statements.UpdateStatement.addUpdateForKey(UpdateStatement.java:94)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.statements.ModificationStatement.addUpdates(ModificationStatement.java:666)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.statements.ModificationStatement.getMutations(ModificationStatement.java:606)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.statements.ModificationStatement.executeWithoutCondition(ModificationStatement.java:413)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.statements.ModificationStatement.execute(ModificationStatement.java:401)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:206)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.QueryProcessor.processPrepared(QueryProcessor.java:472)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.cql3.QueryProcessor.processPrepared(QueryProcessor.java:449)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.transport.messages.ExecuteMessage.execute(ExecuteMessage.java:130)
~[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:507)
[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:401)
[cassandra-all-3.1.1.jar:3.1.1]
> 	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_60-ea]
> 	at org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:164)
[cassandra-all-3.1.1.jar:3.1.1]
> 	at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) [cassandra-all-3.1.1.jar:3.1.1]
> 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60-ea]
> {noformat}
> The root cause seems to be located at *org.apache.cassandra.cql3.Lists:362* :
> {code:java}
>             CellPath elementPath = existingRow.getComplexColumnData(column).getCellByIndex(idx).path();
>             if (value == null)
>             {
>                 params.addTombstone(column);
>             }
>             else if (value != ByteBufferUtil.UNSET_BYTE_BUFFER)
>             {
>                 params.addCell(column, elementPath, value);
>             }
> {code}
>  In the if block, it seems we do not pass the CellPath as it should be and it makes the
asertion _assert column.isComplex() == (path != null);_ fails at 
> *org.apache.cassandra.db.rows:49*
> {code:java}
>     public BufferCell(ColumnDefinition column, long timestamp, int ttl, int localDeletionTime,
ByteBuffer value, CellPath path)
>     {
>         super(column);
>         assert column.isComplex() == (path != null);
>         ....
>    }
> {code}
>  Another remark about the code block in *org.apache.cassandra.cql3.Lists:362*, there
is an *if/else if* but there is no final *else* block to catch all other alternatives, is
it *intended* or just an oversight ?



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

Mime
View raw message