You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2014/02/28 08:29:20 UTC

[jira] [Commented] (CASSANDRA-6782) setting TTL on some columns seems to expire whole row

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

Sylvain Lebresne commented on CASSANDRA-6782:
---------------------------------------------

Well, I would point to [my comment on CASSANDRA-6668|https://issues.apache.org/jira/browse/CASSANDRA-6668?focusedCommentId=13911416&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13911416] as this very much is the exact same thing here.

But to repeat the gist of it, the current semantic of an UPDATE is that it actually also update every column in the WHERE clause, and so the update above actually set a TTL on all the columns of the row. I don't disagree that this current semantic is rather intuitive though, but this is not a new semantic to 2.1 so changing it, while technically trivial, is a potential issue for backward compatibility. Though maybe CASSANDRA-6668 and this ticket suggests that said current semantic is unintuitive enough that nobody could seriously have been relying on it and that we'd better "fix" it. I sure would not hesitate to change it if there wasn't the risk of maybe breaking a few users.

> setting TTL on some columns seems to expire whole row
> -----------------------------------------------------
>
>                 Key: CASSANDRA-6782
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6782
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: java version "1.7.0_51"
> cassandra from trunk: 9c4824d6c476
>            Reporter: Russ Hatch
>
> I create a table with 4 columns, set a ttl on 2 of the columns and when the TTL is up, the entire row disappears.
> {noformat}
> cqlsh:myks> CREATE TABLE paging_test (
>         ...   id int,
>         ...   mytext text,
>         ...   anothervalue text,
>         ...   somevalue text,
>         ...   PRIMARY KEY (id, mytext)
>         ... );
> cqlsh:myks> insert into paging_test (id, mytext, anothervalue, somevalue) values (1, 'foo', 'some', 'another');
> cqlsh:myks> select * from paging_test;
>  id | mytext | anothervalue | somevalue
> ----+--------+--------------+-----------
>   1 |    foo |         some |   another
> (1 rows)
> cqlsh:myks> update paging_test using ttl 10
>         ...   set somevalue='one', anothervalue='two'
>         ...   where id = 1 and mytext = 'foo';
> cqlsh:myks> select * from paging_test;
>  id | mytext | anothervalue | somevalue
> ----+--------+--------------+-----------
>   1 |    foo |          two |       one
> (1 rows)
> cqlsh:myks> -- wait for it....
> cqlsh:myks> select * from paging_test;
> (0 rows)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)