cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Yeschenko (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CASSANDRA-7537) Updates and partition tombstones are not given the same timestamp in a CAS batch
Date Wed, 11 Nov 2015 17:04:11 GMT

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

Aleksey Yeschenko resolved CASSANDRA-7537.
------------------------------------------
       Resolution: Not A Problem
    Fix Version/s:     (was: 2.1.x)

> Updates and partition tombstones are not given the same timestamp in a CAS batch
> --------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-7537
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7537
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Nicolas Favre-Felix
>
> Create a table with one partition and 2 CQL rows:
> {code}
> CREATE TABLE t1 (
>     k text,
>     c text,
>     v text,
>     PRIMARY KEY(k,c)
> );
> BEGIN BATCH
>     INSERT INTO t1 (k,c,v) VALUES ('x','1','1');
>     INSERT INTO t1 (k,c,v) VALUES ('x','2','2');
> APPLY BATCH;
> {code}
> CAS-delete the full partition based on the expected value of a single column:
> {code}
> cqlsh:ks1> SELECT * FROM t1 WHERE k='x';
>  k | c | v
> ---+---+---
>  x | 1 | 1
>  x | 2 | 2
> (2 rows)
> cqlsh:ks1> BEGIN BATCH
>        ...     UPDATE t1 SET v = '0' WHERE k = 'x' AND c = '1' IF v = '1';
>        ...     DELETE FROM t1 WHERE k = 'x';
>        ... APPLY BATCH;
>  [applied]
> -----------
>       True
> cqlsh:ks1> SELECT * FROM t1 WHERE k='x';
>  k | c | v
> ---+---+---
>  x | 1 | 0
> (1 rows)
> {code}
> sstable2json reports that the updated column has a timestamp 1 greater than the partition
delete:
> {code}
> {"key": "78","metadata": {"deletionInfo": {"markedForDeleteAt":1405097039224999,"localDeletionTime":1405097039}},"columns":
[["1:v","0",1405097039225000]]}
> {code}
> All mutations in a CAS batch should be applied with the same timestamp.



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

Mime
View raw message