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

Mike Adamson edited comment on CASSANDRA-19034 at 11/24/23 5:12 PM:
--------------------------------------------------------------------

Here are patches for 5.0 and trunk:

|[5.0|https://github.com/apache/cassandra/pull/2929]|[CI|https://app.circleci.com/pipelines/github/mike-tr-adamson/cassandra/401/workflows/6ab79f11-948d-4f95-b80e-6db662bb30fc]|
|[trunk|https://github.com/apache/cassandra/pull/2930]|[CI|https://app.circleci.com/pipelines/github/mike-tr-adamson/cassandra/402/workflows/92aacb84-fd3a-48e0-9fb2-d1e2fe6fc71a]|

This fixes two specific issues in the code:
# Composite partition indexes were not working as expected because of an 
optimisation we'd made during the CEP. We moved the check for the static row in 
StorageAttachedIndexSearcher.applyIndexFilter to the top of the method before 
the full partition check. This was wrong for composite partition indexes. 
# Static primary keys were not being compared correctly against non-static 
primary keys in the same partition. They should be equal but were being 
compared as less than. This resulted in intersections between static and 
non-static indexes never returning any rows.


was (Author: mike_tr_adamson):
Here are patches for 5.0 and trunk:

|[5.0|https://github.com/apache/cassandra/pull/2929]|[CI|https://app.circleci.com/pipelines/github/mike-tr-adamson/cassandra/401/workflows/6ab79f11-948d-4f95-b80e-6db662bb30fc]|
|[trunk|https://github.com/apache/cassandra/pull/2930]|[CI|https://app.circleci.com/pipelines/github/mike-tr-adamson/cassandra/402/workflows/92aacb84-fd3a-48e0-9fb2-d1e2fe6fc71a]|

> SelectTest fails when run with SAI index
> ----------------------------------------
>
>                 Key: CASSANDRA-19034
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19034
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Feature/SAI
>            Reporter: Branimir Lambov
>            Assignee: Mike Adamson
>            Priority: Normal
>             Fix For: 5.0-beta
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When run with SAI index, the following two tests error out:
> {code}
> [junit-timeout] Testcase: 
> testContainsKeyAndContainsWithIndexOnMapValue(org.apache.cassandra.cql3.validation.operations.SelectTest)-_jdk11:
>    FAILED
> [junit-timeout] Got less rows than expected. Expected 1 but got 0
> [junit-timeout] junit.framework.AssertionFailedError: Got less rows than 
> expected. Expected 1 but got 0
> [junit-timeout]       at 
> org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:1849)
> [junit-timeout]       at 
> org.apache.cassandra.cql3.validation.operations.SelectTest.lambda$testContainsKeyAndContainsWithIndexOnMapValue$9(SelectTest.java:625)
> [junit-timeout]       at 
> org.apache.cassandra.cql3.CQLTester.beforeAndAfterFlush(CQLTester.java:2238)
> [junit-timeout]       at 
> org.apache.cassandra.cql3.validation.operations.SelectTest.testContainsKeyAndContainsWithIndexOnMapValue(SelectTest.java:618)
> [junit-timeout]       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [junit-timeout]       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> [junit-timeout]       at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> [junit-timeout] 
> [junit-timeout] 
> [junit-timeout] Testcase: 
> testFilterWithIndexForContains(org.apache.cassandra.cql3.validation.operations.SelectTest)-_jdk11:
>   FAILED
> [junit-timeout] Invalid value for row 1 column 0 (k1 of type int), expected 
> <1> but got <0>
> [junit-timeout] Invalid value for row 1 column 2 (v of type set<int>), 
> expected <{4, 5, 6}> but got <{2, 3, 4}>
> [junit-timeout] 
> [junit-timeout] junit.framework.AssertionFailedError: Invalid value for row 1 
> column 0 (k1 of type int), expected <1> but got <0>
> [junit-timeout] Invalid value for row 1 column 2 (v of type set<int>), 
> expected <{4, 5, 6}> but got <{2, 3, 4}>
> [junit-timeout] 
> [junit-timeout]       at 
> org.apache.cassandra.cql3.CQLTester.assertRows(CQLTester.java:1826)
> [junit-timeout]       at 
> org.apache.cassandra.cql3.validation.operations.SelectTest.lambda$testFilterWithIndexForContains$6(SelectTest.java:543)
> [junit-timeout]       at 
> org.apache.cassandra.cql3.CQLTester.beforeAndAfterFlush(CQLTester.java:2240)
> [junit-timeout]       at 
> org.apache.cassandra.cql3.validation.operations.SelectTest.testFilterWithIndexForContains(SelectTest.java:542)
> [junit-timeout]       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [junit-timeout]       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> [junit-timeout]       at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> {code}
> The latter seems to be giving the results in the wrong order, and the order 
> flips when the data is flushed.
> Caught during preparation of _latest config that would switch default to SAI 
> (CASSANDRA-18753).



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to