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 2024/01/26 22:57:00 UTC

[jira] [Commented] (CASSANDRA-19278) AND queries involving both static and regular columns can hide matches from Memtable-attached indexes

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

Caleb Rackliffe commented on CASSANDRA-19278:
---------------------------------------------

The 5.0 patch ended up cherry-picking cleanly to trunk, and CI looks good for both branches (modulo a couple pre-existing issues).

[~pkolaczk] [~ifesdjeen] The only thing I'd wait for, at this point, is possibly pulling in the statics torture test [here|https://github.com/apache/cassandra/commit/67fdda4249363557aceca28d0000f0865f0a341a#diff-d9b9ba4b4e071f9195d5488d60043f4fdcf84352b3ee1c2e9b1cce483c52bc27]. We could also just include that w/ CASSANDRA-18275, which is what we were working on when we discovered this issue in the first place. I'd lean toward committing what we have here, which is itself supported by a bunch of new randomized tests.

Thoughts?

> AND queries involving both static and regular columns can hide matches from Memtable-attached indexes
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-19278
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19278
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Feature/SAI
>            Reporter: Caleb Rackliffe
>            Assignee: Caleb Rackliffe
>            Priority: Normal
>             Fix For: 5.0-rc, 5.x
>
>         Attachments: ci_summary-1.html, ci_summary.html, result_details.tar-1.gz, result_details.tar.gz
>
>          Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> As part of our ongoing work on CASSANDRA-18275, Harry started surfacing errors shortly after we added static columns to the schema of {{SingleNodeSAITest}}. After a bit of debugging, I was able to come up with the following concrete repro:
> {noformat}
> import org.junit.Test;
> import org.apache.cassandra.cql3.UntypedResultSet;
> import org.apache.cassandra.index.sai.utils.SAIRandomizedTester;
> public class InMemoryIntersectionsTest extends SAIRandomizedTester
> {
>     @Test
>     public void staticAndRegularIntersection()
>     {
>         createTable("CREATE TABLE %s (pk int, ck int, v1 int, s1 int static, PRIMARY KEY(pk, ck))");
>         createIndex("CREATE INDEX ON %s(v1) USING 'sai'");
>         createIndex("CREATE INDEX ON %s(s1) USING 'sai'");
>         execute("INSERT INTO %s (pk, ck, v1) VALUES (?, ?, ?)", 0, 1, 0);
>         execute("INSERT INTO %s (pk, ck, v1) VALUES (?, ?, ?)", 0, 2, 1);
>         execute("INSERT INTO %s (pk, ck, v1) VALUES (?, ?, ?)", 0, 3, 2);
>         execute("INSERT INTO %s (pk, ck, v1) VALUES (?, ?, ?)", 0, 4, 3);
>         execute("INSERT INTO %s (pk, ck, v1) VALUES (?, ?, ?)", 0, 5, 4);
>         execute("INSERT INTO %s (pk, ck, v1) VALUES (?, ?, ?)", 0, 6, 5);
>         execute("INSERT INTO %s (pk, s1) VALUES (?, ?)", 0, 100);
> 	// Flushing here passes test
>         UntypedResultSet result1 = execute("SELECT * FROM %s WHERE pk = ? AND v1 > ?", 0, 2);
>         assertRowCount(result1, 3);
>         UntypedResultSet result2 = execute("SELECT * FROM %s WHERE pk = ? AND v1 > ? AND s1 = ?", 0, 2, 100);        
>         assertRowCount(result2, 3); // Only returns one result!
>     }
> }
> {noformat}
> Flushing memtables immediately before the queries passes the test, but it seems we have an issue with how the {{PrimaryKey}} iterators produced by static and regular column indexes are intersected when the iterators come from Memtable-attached indexes. Once the root cause of this is determined, it might make some sense to enhance {{RandomIntersectionTest}} to cover this interaction as well, just in case it turns up further problems.



--
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