[ https://issues.apache.org/jira/browse/CASSANDRA-6668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
DOAN DuyHai updated CASSANDRA-6668: ----------------------------------- Description: The expiration of row when all TTLed columns have expired is inconsistent Scenario 1) {code:sql} cqlsh:test> create table ttl_issue(id int primary key,collection set<text>); cqlsh:test> update ttl_issue USING TTL 2 set collection = collection + {'test_2'} where id=10; cqlsh:test> update ttl_issue USING TTL 3 set collection = collection + {'test_3'} where id=10; cqlsh:test> select * from ttl_issue; id | collection ----+---------------------- 10 | {'test_2', 'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+---------------------- 10 | {'test_2', 'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+------------ 10 | {'test_3'} cqlsh:test> select * from ttl_issue; cqlsh:test> {code} As we can see, after a few seconds, both columns of the collection are expired. When all columns of the set have expired, the SELECT * FROM ttl_issue *returns no result, meaning that the whole row has expired.* Scenario 2) {code:sql} cqlsh:test> update ttl_issue USING TTL 3 set collection = collection + {'test_3'} where id=11; cqlsh:test> update ttl_issue USING TTL 1000 set collection = collection + {'test_1000'} where id=11; cqlsh:test> update ttl_issue set collection = collection - {'test_1000'} where id=11; cqlsh:test> select * from ttl_issue; id | collection ----+------------ 11 | {'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+------------ 11 | {'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+------------ 11 | {'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+------------ 11 | null {code} In this second scenario. We add elements to the collection with TTL but then remove one of them. *After a while, although all TTLed columns have expired, the row is till there with only the primary key present.* One should expect to get the same behavior as in scenario 1), e.g. the complete row should expire. I've also tried removing one element from collection using TTL 0 ({code:sql}update ttl_issue USING TTL 0 set collection = collection - {'test_1000'} where id=11;{code}) but the result is the same. Quick guest: bug on row deletion marker for specific collection element append/remove ? was: The expiration of row when all TTLed columns have expired is inconsistent Scenario 1) {code:sql} cqlsh:test> create table ttl_issue(id int primary key,collection set<text>); cqlsh:test> update ttl_issue USING TTL 2 set collection = collection + {'test_2'} where id=10; cqlsh:test> update ttl_issue USING TTL 3 set collection = collection + {'test_3'} where id=10; cqlsh:test> select * from ttl_issue; id | collection ----+---------------------- 10 | {'test_2', 'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+---------------------- 10 | {'test_2', 'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+------------ 10 | {'test_3'} cqlsh:test> select * from ttl_issue; cqlsh:test> {code} As we can see, after a few seconds, both columns of the collection are expired. When all columns of the set have expired, the SELECT * FROM ttl_issue *returns no result, meaning that the whole row has expired.* Scenario 2) {code:sql} cqlsh:test> update ttl_issue USING TTL 3 set collection = collection + {'test_3'} where id=11; cqlsh:test> update ttl_issue USING TTL 1000 set collection = collection + {'test_1000'} where id=11; cqlsh:test> update ttl_issue set collection = collection - {'test_1000'} where id=11; cqlsh:test> select * from ttl_issue; id | collection ----+------------ 11 | {'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+------------ 11 | {'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+------------ 11 | {'test_3'} cqlsh:test> select * from ttl_issue; id | collection ----+------------ 11 | null {code} In this second scenario. We add elements to the collection with TTL but then remove one of them. *After a while, although all TTLed columns have expired, the row is till there with only the primary key present.* One should expect to get the same behavior as in scenario 1), e.g. the complete row should expire. I've also tried removing one element from collection using TTL 0 ({code:sql}update ttl_issue USING TTL 0 set collection = collection - {'test_1000'} where id=11;{code}) but the result is the same. > Inconsistent handling of row expiration using TTL in collections > ---------------------------------------------------------------- > > Key: CASSANDRA-6668 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6668 > Project: Cassandra > Issue Type: Bug > Components: Core > Environment: Apache Cassandra 2.0.3 > Apache Cassandra 1.2.8 > CQLSH client 3.1.6 > Reporter: DOAN DuyHai > Priority: Critical > > The expiration of row when all TTLed columns have expired is inconsistent > Scenario 1) > {code:sql} > cqlsh:test> create table ttl_issue(id int primary key,collection set<text>); > cqlsh:test> update ttl_issue USING TTL 2 set collection = collection + > {'test_2'} where id=10; > cqlsh:test> update ttl_issue USING TTL 3 set collection = collection + > {'test_3'} where id=10; > cqlsh:test> select * from ttl_issue; > id | collection > ----+---------------------- > 10 | {'test_2', 'test_3'} > cqlsh:test> select * from ttl_issue; > id | collection > ----+---------------------- > 10 | {'test_2', 'test_3'} > cqlsh:test> select * from ttl_issue; > id | collection > ----+------------ > 10 | {'test_3'} > cqlsh:test> select * from ttl_issue; > cqlsh:test> > {code} > As we can see, after a few seconds, both columns of the collection are > expired. When all columns of the set have expired, the SELECT * FROM > ttl_issue *returns no result, meaning that the whole row has expired.* > Scenario 2) > {code:sql} > cqlsh:test> update ttl_issue USING TTL 3 set collection = collection + > {'test_3'} where id=11; > cqlsh:test> update ttl_issue USING TTL 1000 set collection = collection + > {'test_1000'} where id=11; > cqlsh:test> update ttl_issue set collection = collection - {'test_1000'} > where id=11; > cqlsh:test> select * from ttl_issue; > id | collection > ----+------------ > 11 | {'test_3'} > cqlsh:test> select * from ttl_issue; > id | collection > ----+------------ > 11 | {'test_3'} > cqlsh:test> select * from ttl_issue; > id | collection > ----+------------ > 11 | {'test_3'} > cqlsh:test> select * from ttl_issue; > id | collection > ----+------------ > 11 | null > {code} > In this second scenario. We add elements to the collection with TTL but then > remove one of them. *After a while, although all TTLed columns have expired, > the row is till there with only the primary key present.* > One should expect to get the same behavior as in scenario 1), e.g. the > complete row should expire. > I've also tried removing one element from collection using TTL 0 > ({code:sql}update ttl_issue USING TTL 0 set collection = collection - > {'test_1000'} where id=11;{code}) but the result is the same. > Quick guest: bug on row deletion marker for specific collection element > append/remove ? -- This message was sent by Atlassian JIRA (v6.1.5#6160)