[
https://issues.apache.org/jira/browse/CASSANDRA-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14386114#comment-14386114
]
Stefania edited comment on CASSANDRA-6363 at 3/30/15 6:38 AM:
--------------------------------------------------------------
[~thobbs]:
- tested manually and with dtest below in cassandra-2.0 and cannot reproduce.
- tested with dtest below in cassandra-2.1 and cannot reproduce
- tested with dtest below in trunk and cannot reproduce
The dtest:
https://github.com/stef1927/cassandra-dtest/commit/eaf56385405db4702d869699e80ad4d00b41cec4
{code}
def delete_with_ttl_expired_test(self):
"""
Updating a row with a ttl does not prevent deletion, test for
CASSANDRA-6363
"""
self.cursor1.execute("DROP TABLE IF EXISTS session")
self.cursor1.execute("CREATE TABLE session (id text, usr text, valid
int, PRIMARY KEY (id))")
self.cursor1.execute("insert into session (id, usr) values ('abc',
'abc')")
self.cursor1.execute("update session using ttl 1 set valid = 1 where id
= 'abc'")
self.smart_sleep(time.time(), 1)
self.cursor1.execute("delete from session where id = 'abc' if usr
='abc'")
assert_row_count(self.cursor1, 'session', 0)
{code}
Please confirm it's OK to close.
was (Author: stefania):
[~thobbs]:
- tested manually and with dtest below in cassandra-2.0 and cannot reproduce.
- tested with dtest below in cassandra-2.1 and cannot reproduce
- tested with dtest below in trunk and cannot reproduce
The dtest:
https://github.com/stef1927/cassandra-dtest/commit/eaf56385405db4702d869699e80ad4d00b41cec4
{code}
def delete_with_ttl_expired_test(self):
"""
Updating a row with a ttl does not prevent deletion, test for
CASSANDRA-6363
"""
self.cursor1.execute("DROP TABLE IF EXISTS session")
self.cursor1.execute("CREATE TABLE session (id text, usr text, valid
int, PRIMARY KEY (id))")
self.cursor1.execute("insert into session (id, usr) values ('abc',
'abc')")
self.cursor1.execute("update session using ttl 1 set valid = 1 where id
= 'abc'")
self.smart_sleep(time.time(), 1)
self.cursor1.execute("delete from session where id = 'abc' if usr
='abc'")
assert_row_count(self.cursor1, 'session', 0)
{code}
> CAS not applied on rows containing an expired ttl column
> --------------------------------------------------------
>
> Key: CASSANDRA-6363
> URL: https://issues.apache.org/jira/browse/CASSANDRA-6363
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Environment: Linux/x64 2.0.2 4-node cluster
> Reporter: MichaĆ Ziemski
> Assignee: Stefania
>
> CREATE TABLE session (
> id text,
> usr text,
> valid int,
> PRIMARY KEY (id)
> );
> insert into session (id, usr) values ('abc', 'abc');
> update session using ttl 1 set valid = 1 where id = 'abc';
> (wait 1 sec)
> And
> delete from session where id = 'DSYUCTCLSOEKVLAQWNWYLVQMEQGGXD' if usr
> ='demo';
> Yields:
> [applied] | usr
> -----------+-----
> False | abc
> Rather than applying the delete.
> Executing:
> update session set valid = null where id = 'abc';
> and again
> delete from session where id = 'DSYUCTCLSOEKVLAQWNWYLVQMEQGGXD' if usr
> ='demo';
> Positively deletes the row.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)