cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-9198) Deleting from an empty list produces an error
Date Mon, 20 Apr 2015 16:07:00 GMT

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

Sylvain Lebresne commented on CASSANDRA-9198:
---------------------------------------------

bq. last time we discussed that subject, we agreed that as we complain on invalid index for
lists, not complaining when trying to delete from an empty list was not really consistent.


Yes, but I hadn't though of the idempotency issue at the time, and I do think we should make
thing idempotent as much as possible, so +1 for not complaining in that case. And since this
case was buggy until CASSANDRA_9077, I suggest we fix that before 2.1.5 is released.

> Deleting from an empty list produces an error
> ---------------------------------------------
>
>                 Key: CASSANDRA-9198
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9198
>             Project: Cassandra
>          Issue Type: Bug
>          Components: API
>            Reporter: Olivier Michallat
>            Assignee: Benjamin Lerer
>            Priority: Minor
>             Fix For: 3.0
>
>
> While deleting an element from a list that does not contain it is a no-op, deleting it
from an empty list causes an error.
> This edge case is a bit inconsistent, because it makes list deletion non idempotent:
> {code}
> cqlsh:test> create table foo (k int primary key, v list<int>);
> cqlsh:test> insert into foo(k,v) values (1, [1,2]);
> cqlsh:test> update foo set v = v - [1] where k = 1;
> cqlsh:test> update foo set v = v - [1] where k = 1;
> cqlsh:test> update foo set v = v - [2] where k = 1;
> cqlsh:test> update foo set v = v - [2] where k = 1;
> InvalidRequest: code=2200 [Invalid query] message="Attempted to delete an element from
a list which is null"
> {code}
> With speculative retries coming to the drivers, idempotency becomes more important because
it determines which query we might retry or not. So it would be better if deleting from an
empty list succeeded.



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

Mime
View raw message