[
https://issues.apache.org/jira/browse/CASSANDRA-10796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15036307#comment-15036307
]
Tyler Hobbs commented on CASSANDRA-10796:
-----------------------------------------
||branch||testall||dtest||
|[CASSANDRA-10796|https://github.com/thobbs/cassandra/tree/CASSANDRA-10796]|[testall|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-10796-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-10796-dtest]|
|[CASSANDRA-10796-3.1|https://github.com/thobbs/cassandra/tree/CASSANDRA-10796-3.1]|[testall|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-10796-3.1-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-10796-3.1-dtest]|
|[CASSANDRA-10796-trunk|https://github.com/thobbs/cassandra/tree/CASSANDRA-10796-trunk]|[testall|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-10796-trunk-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/thobbs/job/thobbs-CASSANDRA-10796-trunk-dtest]|
In addition to fixing the bug, I made a couple of related changes in this patch:
* Make the row and cell {{toString()}} methods more robust. The previous
versions were normally fine, but didn't deal with single-cell tombstones where
the type does _not_ support empty ByteBuffers, such as ShortType.
* Move the more schema-focused test cases in {{ViewTest}} to
{{ViewSchemaTest}}. I simply did this because {{ViewTest}} was getting long,
and would normally hit the timeout on my machine. The move makes the diff a
little messy, but I did add two new unit tests to the bottom of {{ViewTest}} to
cover single-column deletions.
> Views do not handle single-column deletions of view PK columns correctly
> ------------------------------------------------------------------------
>
> Key: CASSANDRA-10796
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10796
> Project: Cassandra
> Issue Type: Bug
> Components: Coordination
> Reporter: Tyler Hobbs
> Assignee: Tyler Hobbs
> Fix For: 3.0.1, 3.1
>
>
> When a materialized view has a regular base column in its primary key, and
> that regular base column is deleted through a single-column deletion, the
> view does not handle it correctly, and may produce an error.
> For example, with a table like:
> {noformat}
> CREATE TABLE foo (
> a int, b int, c int, d int
> PRIMARY KEY (a, b)
> )
> {noformat}
> and a view like:
> {noformat}
> CREATE MATERIALIZED VIEW BAR
> AS SELECT * FROM foo
> WHERE ...
> PRIMARY KEY (a, d, b)
> {noformat}
> a deletion like this will not be handled correctly:
> {noformat}
> DELETE d FROM foo WHERE a = 0 AND b = 0
> {noformat}
> The source of the problem is that we aren't checking whether individual cells
> in the TemporalRow are live or not when building the clustering and partition
> key for the row. Instead, we're just using the cell value, which is an empty
> ByteBuffer.
> I should have a patch with a fix and tests posted tomorrow.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)