You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Caleb Rackliffe (Jira)" <ji...@apache.org> on 2025/02/05 21:38:00 UTC

[jira] [Comment Edited] (CASSANDRA-20189) Avoid possible consistency violations for SAI intersection queries over repaired index matches and multiple non-indexed column matches

    [ https://issues.apache.org/jira/browse/CASSANDRA-20189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17921599#comment-17921599 ] 

Caleb Rackliffe edited comment on CASSANDRA-20189 at 2/5/25 9:37 PM:
---------------------------------------------------------------------

|[trunk|https://github.com/apache/cassandra/pull/3779]| [^ci_summary.html] |


was (Author: maedhroz):
|[trunk|https://github.com/apache/cassandra/pull/3779]| [^ci_summary.html] |

> Avoid possible consistency violations for SAI intersection queries over repaired index matches and multiple non-indexed column matches
> --------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-20189
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20189
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: Consistency/Coordination, Feature/SAI
>            Reporter: Caleb Rackliffe
>            Assignee: Caleb Rackliffe
>            Priority: Normal
>             Fix For: 5.0.x, 5.x
>
>         Attachments: ci_summary.html, result_details.tar.gz
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> {{FilterTree}}, which is responsible for SAI's post-filtering, is too aggressive about automatically using strict filtering when a.) only repaired matches are returned from index columns and b.) there are still multiple non-indexed columns that must be post-filtered. The following test illustrates this:
> {noformat}
> @Test
> public void testPartialUpdatesOnNonIndexedColumnsAfterRepair()
> {
>    CLUSTER.schemaChange(withKeyspace("CREATE TABLE %s.partial_updates (k int PRIMARY KEY, a int, b int, c int) WITH read_repair = 'NONE'"));
>    CLUSTER.schemaChange(withKeyspace("CREATE INDEX ON %s.partial_updates(a) USING 'sai'"));
>    SAIUtil.waitForIndexQueryable(CLUSTER, KEYSPACE);
>    CLUSTER.coordinator(1).execute(withKeyspace("INSERT INTO %s.partial_updates(k, a) VALUES (0, 1) USING TIMESTAMP 1"), ConsistencyLevel.ALL);
>    CLUSTER.get(1).nodetoolResult("repair", KEYSPACE).asserts().success();
>    // insert a split row
>    CLUSTER.get(1).executeInternal(withKeyspace("INSERT INTO %s.partial_updates(k, b) VALUES (0, 2) USING TIMESTAMP 2"));
>    CLUSTER.get(2).executeInternal(withKeyspace("INSERT INTO %s.partial_updates(k, c) VALUES (0, 3) USING TIMESTAMP 3"));
>    String select = withKeyspace("SELECT * FROM %s.partial_updates WHERE a = 1 AND b = 2 AND c = 3 ALLOW FILTERING");
>    Object[][] initialRows = CLUSTER.coordinator(1).execute(select, ConsistencyLevel.ALL);
>    assertRows(initialRows, row(0, 1, 2, 3));
> }
> {noformat}
> This should be easy to fix without adversely affecting performance too much, given the selectivity of the clauses on the indexed columns still determines the upper bound on how many rows can be returned to the coordinator for coordinator-side filtering.



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

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