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 2012/11/14 10:58:12 UTC

[jira] [Resolved] (CASSANDRA-4963) A cql collection 'column' doesn't own it's ttl

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

Sylvain Lebresne resolved CASSANDRA-4963.
-----------------------------------------

    Resolution: Not A Problem

This works as designed. When a TTL is used in a statement, it only applies to the _values_ that this statement updates/inserts.

For the record, I'm not contesting that "a collection only ever have a TTL as a whole and if a statement with a TTL updates/inserts a collection, it sets that collection TTL" wouldn't be a valid alternative semantic (at least on paper), but I do pretend that the current semantic is superior in practice because:
# It's more generic/flexible. You can implement the 'the collection has a TTL as a whole' semantic using the current one client side (at least you can implement it as well as we could internally). The reverse is not true.
# Implementing that latter semantic would require us to do a read before we write (even when no ttl is used because you'd always have to know if the collection already exists with a ttl, which is a no go in itself) and to have some distributed locking (or at least I don't see how we could guarantee otherwise that all the internal columns composing the collection always have the same TTL).

                
> A cql collection 'column' doesn't own it's ttl
> ----------------------------------------------
>
>                 Key: CASSANDRA-4963
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4963
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.0 beta 2
>            Reporter: Dave Brosius
>            Priority: Minor
>
> if you add a collection column with a ttl, then later update the collection by adding a new element, the 'under the covers' column representing the added value has no ttl. It seems like ttl tombstoning should only be allowed to remove the collection in entirety, or not touch it, but not be allowed to modify it by removing parts.
> example
> cqlsh> create keyspace collections with replication = {'class':'SimpleStrategy', 'replication_factor':1};
> cqlsh> use collections;
> cqlsh:collections> create table collections (key int primary key, aset set<text>);
> cqlsh:collections> insert into collections (key, aset) values (1, {'fee', 'fi'}) using ttl 10000;
> cqlsh:collections> update collections set aset = aset + {'fo', 'fum'} where key = 1;
> cqlsh:collections> exit
> cassandra-cli
> [default@unknown] use collections
> [default@collections] get collections[1];
> => (column=, value=, timestamp=1352874321877000)
> => (column=aset:666565, value=, timestamp=1352874314717000, ttl=10000)
> => (column=aset:6669, value=, timestamp=1352874314717000, ttl=10000)
> => (column=aset:666f, value=, timestamp=1352874321877000)
> => (column=aset:66756d, value=, timestamp=1352874321877000)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira