[
https://issues.apache.org/jira/browse/CASSANDRA-15977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17202094#comment-17202094
]
Andres de la Peña commented on CASSANDRA-15977:
-----------------------------------------------
The new
[{{ReadRepairQueryTypesTest}}|https://github.com/adelapena/cassandra/blob/15977-trunk/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java]
in-JVM dtest has exposed a bug in
[{{ColumnFilter#fetchedCellIsQueried}}|https://github.com/apache/cassandra/blob/d4eba9faa1b57fed205813a639fe53bbbdc06ef1/src/java/org/apache/cassandra/db/filter/ColumnFilter.java#L233].
This method doesn't properly verify that the base column for the cell is
queried, in such a way that it wrongly considers queried every cell in a not
queried complex column. That means that entire unselected not-frozen
collections and UDTs are read-repaired when they are not selected. Also, due to
CASSANDRA-10657, if the cells come from a SSTable then only the clustering keys
of such unselected cells are sent to the other nodes, missing their values. For
example, if we have:
{code}
CREATE KEYSPACE k WITH replication = {'class': 'SimpleStrategy',
'replication_factor': 2};
CREATE TABLE t(k int PRIMARY KEY, a map<int,int>, b int);
INSERT INTO t (k, a, b) VALUES (0, {1:10, 2:20}, 3); -- only in replica 1
SELECT b FROM t; -- returns "3"
{code}
Read repair for above query will (wrongly) write the row {{(0, \{1:10, 2:20\},
3)}} in the second replica if the data comes from a memtable, and {{(0,
\{1:null, 2:null\}, 3)}} if the data comes from a sstable.
The PR adds a simple fix for this problem and [a small specific unit
test|https://github.com/adelapena/cassandra/blob/15977-trunk/test/unit/org/apache/cassandra/db/filter/ColumnFilterTest.java#L196-L300].
We should probably port back the fix and its unit test to the affected
previous branches even if we only add the new in-JVM dtests in trunk.
> 4.0 quality testing: Read Repair
> --------------------------------
>
> Key: CASSANDRA-15977
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15977
> Project: Cassandra
> Issue Type: Task
> Components: Test/dtest/java, Test/unit
> Reporter: Andres de la Peña
> Assignee: Andres de la Peña
> Priority: Normal
> Fix For: 4.0-beta
>
> Time Spent: 13h 10m
> Remaining Estimate: 0h
>
> This is a subtask of CASSANDRA-15579 focusing on read repair.
> [This
> document|https://docs.google.com/document/d/1-gldHcdLSMRbDhhI8ahs_tPeAZsjurjXr38xABVjWHE/edit?usp=sharing]
> lists and describes the existing functional tests for read repair, so we can
> have a broad view of what is currently covered. We can comment on this
> document and add ideas for new cases/tests, so it can gradually evolve to a
> more or less detailed test plan.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]