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

Sylvain Lebresne updated CASSANDRA-9733:
----------------------------------------
    Attachment: 9733.patch

A row is considered live if either it has some live cells _or_ it has a live 
"primaryKeyLivenessInfo". The latest bit is because a row can be live even if 
only its primary key columns are set, and in that case it will have no (live) 
cells. To put it another way with an example, if your example was:
{noformat}
execute("INSERT INTO %s (k) VALUES (2)");
execute("UPDATE %s USING TTL 1 SET v1 = 2 WHERE k = 2");
Thread.sleep(1001);
execute("SELECT * FROM %s WHERE k=2");
{noformat}
then we would expect this to return {{[2, null]}} even though the row would 
internally only have cell tombstones.

Further, {{SelectStatement.processPartition}} gets a {{RowIterator}} (by 
opposition to an {{UnfilteredRowIterator}}) and that means that anything 
deleted is already filtered out and it shouldn't have to bother with filtering 
anything (same applies to {{RowCondition}}). So the real problem is that in 
your example, the "primaryKeyLivenessInfo" of the row, which should be deleted 
since the whole row is TTLed, is not. Or more precisely, it is deleted but it 
hasn't been filtered out properly when we transform the 
{{UnfilteredRowIterator}} (contains deleted stuffs) into a {{RowIterator}} 
(should only contain live stuffs) so the code wrongly assumes it to be live.

Attaching the simple patch to fix that.


>  InsertUpdateIfCondition.testConditionalDelete is failing on trunk
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-9733
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9733
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Benjamin Lerer
>            Assignee: Stefania
>         Attachments: 9733.patch
>
>
>  {{InsertUpdateIfCondition.testConditionalDelete}} is failing on trunk. 
> It looks that it got unnoticed because cassci was not running the test due to 
> the fact that the class name does not contains {{Test}}. 



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

Reply via email to