[
https://issues.apache.org/jira/browse/CASSANDRA-10438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14946673#comment-14946673
]
Sam Tunnicliffe commented on CASSANDRA-10438:
---------------------------------------------
Thanks [~aweisberg]. You're right, the change involving
{{onPrimaryKeyLivenessInfo}} wasn't covered because it was an afterthought
really. When I went back to it prompted by your comment, I realised that the
right thing to do was to always have the delta rows take their liveness info
direct from the incoming existing/updated row data.
Unlike cell data, a row always has to have some liveness info (even if that's
empty) so it seemed logical to set these unconditionally rather than only doing
it when there was a mismatch. Also, in the prior code, only {{toInsert}} was
having its liveness set when there was a mismatch. In that case {{toRemove}}
was defaulting to {{LivenessInfo.EMPTY}}, which was more confusing IMO. So I've
pushed an additional commit which fixes that and also adds a condition to the
unit test.
> Overwrites of rows in memtable produce incorrect deltas for indexing
> --------------------------------------------------------------------
>
> Key: CASSANDRA-10438
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10438
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Sam Tunnicliffe
> Assignee: Sam Tunnicliffe
> Fix For: 3.0.0 rc2
>
>
> When a row in the memtable is updated, the delta is supplied to any
> registered indexer. This consists of two {{Row}} objects, representing the
> old and new data in the memtable. As per its javadoc, the contract of
> {{Index.Indexer::updateRow}} is that these old & new rows contain only the
> changed columns, so any column which was not affected by the update will
> appear in neither the new nor old row. The {{RowDiffListener::onCell}} method
> in {{SecondaryIndexManager.WriteTimeTransaction::onUpdated}} which produces
> these deltas uses a reference equality check, where it should be checking
> object equality. This results in unchanged, prexisting cells appearing in the
> {{toInsert}} row.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)