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

Andres de la Peña updated CASSANDRA-19007:
------------------------------------------
    Description: 
{{SELECT}} queries with multi-column replica-side filtering can miss rows if 
the filtered columns are spread across out-of-sync replicas. This dtest 
reproduces the issue:
{code:java}
@Test
public void testMultiColumnReplicaSideFiltering() throws IOException
{
    try (Cluster cluster = init(Cluster.build().withNodes(2).start()))
    {
        cluster.schemaChange(withKeyspace("CREATE TABLE %s.t (k int PRIMARY 
KEY, a int, b int)"));

        // insert a split row
        cluster.get(1).executeInternal(withKeyspace("INSERT INTO %s.t(k, a) 
VALUES (0, 1)"));
        cluster.get(2).executeInternal(withKeyspace("INSERT INTO %s.t(k, b) 
VALUES (0, 2)"));

        String select = withKeyspace("SELECT * FROM %s.t WHERE a = 1 AND b = 2 
ALLOW FILTERING");
        Object[][] initialRows = cluster.coordinator(1).execute(select, ALL);
        assertRows(initialRows, row(0, 1, 2)); // not found!!
    }
}
{code}
This edge case affects queries using {{ALLOW FILTERING}} or any index 
implementation.

The protection mechanism added by CASSANDRA-8272/8273 won't deal with this 
case, since it only solves single-column conflicts.

  was:
{{SELECT}} queries with multi-column replica-side filtering can miss rows if 
the filtered columns are spread across out-of-sync replicas. This dtest 
reproduces the issue:
{code:java}
@Test
public void testMultiColumnReplicaSideFiltering() throws IOException
{
    try (Cluster cluster = init(Cluster.build().withNodes(2).start()))
    {
        cluster.schemaChange(withKeyspace("CREATE TABLE %s.t (k int PRIMARY 
KEY, a int, b int)"));

        // insert a split row
        cluster.get(1).executeInternal(withKeyspace("INSERT INTO %s.t(k, a) 
VALUES (0, 1)"));
        cluster.get(2).executeInternal(withKeyspace("INSERT INTO %s.t(k, b) 
VALUES (0, 2)"));

        String select = withKeyspace("SELECT * FROM %s.t WHERE a = 1 AND b = 2 
ALLOW FILTERING");
        Object[][] initialRows = cluster.coordinator(1).execute(select, ALL);
        assertRows(initialRows, row(0, 1, 2)); // not found!!
    }
}
{code}
This edge case affects queries using either {{ALLOW FILTERING }}or any index 
implementation.

The protection mechanism added by CASSANDRA-8272/8273 won't deal with this 
case, since it only solves single-column conflicts.


> Queries with multi-column replica-side filtering can miss rows
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-19007
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19007
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Consistency/Coordination
>            Reporter: Andres de la Peña
>            Priority: Normal
>
> {{SELECT}} queries with multi-column replica-side filtering can miss rows if 
> the filtered columns are spread across out-of-sync replicas. This dtest 
> reproduces the issue:
> {code:java}
> @Test
> public void testMultiColumnReplicaSideFiltering() throws IOException
> {
>     try (Cluster cluster = init(Cluster.build().withNodes(2).start()))
>     {
>         cluster.schemaChange(withKeyspace("CREATE TABLE %s.t (k int PRIMARY 
> KEY, a int, b int)"));
>         // insert a split row
>         cluster.get(1).executeInternal(withKeyspace("INSERT INTO %s.t(k, a) 
> VALUES (0, 1)"));
>         cluster.get(2).executeInternal(withKeyspace("INSERT INTO %s.t(k, b) 
> VALUES (0, 2)"));
>         String select = withKeyspace("SELECT * FROM %s.t WHERE a = 1 AND b = 
> 2 ALLOW FILTERING");
>         Object[][] initialRows = cluster.coordinator(1).execute(select, ALL);
>         assertRows(initialRows, row(0, 1, 2)); // not found!!
>     }
> }
> {code}
> This edge case affects queries using {{ALLOW FILTERING}} or any index 
> implementation.
> The protection mechanism added by CASSANDRA-8272/8273 won't deal with this 
> case, since it only solves single-column conflicts.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to