[
https://issues.apache.org/jira/browse/CASSANDRA-20323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17929942#comment-17929942
]
Caleb Rackliffe edited comment on CASSANDRA-20323 at 2/25/25 8:17 PM:
----------------------------------------------------------------------
I've been able to isolate a small repro from the seed above. What's odd is that
it only fails with filtering. It may be related to CASSANDRA-19007.
{noformat}
@Test
public void testX()
{
CLUSTER.schemaChange(withKeyspace("CREATE TABLE %s.testX (pk0 bigint, ck0
varint, s0 double static, v0 smallint, PRIMARY KEY (pk0, ck0)) " +
"WITH CLUSTERING ORDER BY (ck0 ASC) AND
read_repair = 'NONE'"));
// CLUSTER.schemaChange(withKeyspace("CREATE INDEX ON %s.testX(s0) USING
'sai'"));
// SAIUtil.waitForIndexQueryable(CLUSTER, KEYSPACE);
CLUSTER.get(1).executeInternal(withKeyspace("INSERT INTO %s.testX (pk0,
ck0, s0, v0) VALUES (4501397456309286501, 15, -1.3193545560974702E211, 21040 -
-9610) USING TIMESTAMP 100"));
CLUSTER.get(3).executeInternal(withKeyspace("INSERT INTO %s.testX (pk0,
ck0, s0, v0) VALUES (4501397456309286501, -105, 1.7367761333573752E182, -11057)
USING TIMESTAMP 102"));
CLUSTER.get(2).executeInternal(withKeyspace("UPDATE %s.testX USING
TIMESTAMP 109 SET s0=1.9091237391303867E-65 + 1.933263240798876E72, v0=5284
WHERE pk0 = 4501397456309286501 AND ck0 = 0"));
CLUSTER.get(3).executeInternal(withKeyspace("INSERT INTO %s.testX (pk0,
ck0, s0, v0) VALUES (4501397456309286501, 3462, 6.873915736748052E-204, 12172)
USING TIMESTAMP 122"));
// We should match on all 4 rows at this point:
String select = withKeyspace("SELECT pk0, ck0 FROM %s.testX WHERE pk0 =
4501397456309286501 AND s0 <= 3.9683118225728584E-104 ALLOW FILTERING");
assertEquals(4, CLUSTER.coordinator(2).execute(select, ALL).length);
// This should delete ck = 0, bringing us down to 3 matches:
CLUSTER.get(3).executeInternal(withKeyspace("DELETE FROM %s.testX USING
TIMESTAMP 135 WHERE pk0 = 4501397456309286501 AND ck0 = 0"));
assertEquals(3, CLUSTER.coordinator(2).execute(select, ALL).length);
// Caused by: java.lang.AssertionError: Unexpected rows found:
// pk0 | ck0 | s0 | v0
// 4501397456309286501 | 0 | 3.9683118225728584E-104 | 5284
//
// Expected:
// pk0 | ck0 | s0 | v0
// 4501397456309286501 | 3462 | 3.9683118225728584E-104 | 12172
// 4501397456309286501 | 15 | 3.9683118225728584E-104 | 30650
// 4501397456309286501 | -105 | 3.9683118225728584E-104 | -11057
}
{noformat}
was (Author: maedhroz):
I've been able to isolate a small repro from the seed above. What's odd is that
it only fails with filtering. I don't think it's related to CASSANDRA-19007.
{noformat}
@Test
public void testX()
{
CLUSTER.schemaChange(withKeyspace("CREATE TABLE %s.testX (pk0 bigint, ck0
varint, s0 double static, v0 smallint, PRIMARY KEY (pk0, ck0)) " +
"WITH CLUSTERING ORDER BY (ck0 ASC) AND
read_repair = 'NONE'"));
// CLUSTER.schemaChange(withKeyspace("CREATE INDEX ON %s.testX(s0) USING
'sai'"));
// SAIUtil.waitForIndexQueryable(CLUSTER, KEYSPACE);
CLUSTER.get(1).executeInternal(withKeyspace("INSERT INTO %s.testX (pk0,
ck0, s0, v0) VALUES (4501397456309286501, 15, -1.3193545560974702E211, 21040 -
-9610) USING TIMESTAMP 100"));
CLUSTER.get(3).executeInternal(withKeyspace("INSERT INTO %s.testX (pk0,
ck0, s0, v0) VALUES (4501397456309286501, -105, 1.7367761333573752E182, -11057)
USING TIMESTAMP 102"));
CLUSTER.get(2).executeInternal(withKeyspace("UPDATE %s.testX USING
TIMESTAMP 109 SET s0=1.9091237391303867E-65 + 1.933263240798876E72, v0=5284
WHERE pk0 = 4501397456309286501 AND ck0 = 0"));
CLUSTER.get(3).executeInternal(withKeyspace("INSERT INTO %s.testX (pk0,
ck0, s0, v0) VALUES (4501397456309286501, 3462, 6.873915736748052E-204, 12172)
USING TIMESTAMP 122"));
// We should match on all 4 rows at this point:
String select = withKeyspace("SELECT pk0, ck0 FROM %s.testX WHERE pk0 =
4501397456309286501 AND s0 <= 3.9683118225728584E-104 ALLOW FILTERING");
assertEquals(4, CLUSTER.coordinator(2).execute(select, ALL).length);
// This should delete ck = 0, bringing us down to 3 matches:
CLUSTER.get(3).executeInternal(withKeyspace("DELETE FROM %s.testX USING
TIMESTAMP 135 WHERE pk0 = 4501397456309286501 AND ck0 = 0"));
assertEquals(3, CLUSTER.coordinator(2).execute(select, ALL).length);
// Caused by: java.lang.AssertionError: Unexpected rows found:
// pk0 | ck0 | s0 | v0
// 4501397456309286501 | 0 | 3.9683118225728584E-104 | 5284
//
// Expected:
// pk0 | ck0 | s0 | v0
// 4501397456309286501 | 3462 | 3.9683118225728584E-104 | 12172
// 4501397456309286501 | 15 | 3.9683118225728584E-104 | 30650
// 4501397456309286501 | -105 | 3.9683118225728584E-104 | -11057
}
{noformat}
> Multi-node filtering query on static column appears to miss partition delete
> ----------------------------------------------------------------------------
>
> Key: CASSANDRA-20323
> URL: https://issues.apache.org/jira/browse/CASSANDRA-20323
> 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
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> This test can be inserted into ReplicaFilteringProtectionTest or any other
> in-JVM dtest that has a 3 node cluster:
>
> {noformat}
> @Test
> public void testSingleStaticExpression()
> {
> cluster.schemaChange(withKeyspace("CREATE TABLE %s.single_static (pk0
> boolean, ck0 ascii, s1 tinyint static, v0 boolean, PRIMARY KEY (pk0, ck0)) " +
> "WITH CLUSTERING ORDER BY (ck0 ASC)
> AND read_repair = 'NONE'"));
> cluster.get(3).executeInternal(withKeyspace("UPDATE %s.single_static
> USING TIMESTAMP 1 SET v0 = false WHERE pk0 = true AND ck0 = 'D'"));
> cluster.get(1).executeInternal(withKeyspace("DELETE FROM
> %s.single_static USING TIMESTAMP 2 WHERE pk0 = true"));
> cluster.get(1).executeInternal(withKeyspace("INSERT INTO
> %s.single_static (pk0, ck0, s1, v0) VALUES (true, 'G', -114, true) USING
> TIMESTAMP 3"));
> cluster.get(3).executeInternal(withKeyspace("INSERT INTO
> %s.single_static (pk0, ck0) VALUES (true, 'F') USING TIMESTAMP 4"));
> cluster.get(1).executeInternal(withKeyspace("INSERT INTO
> %s.single_static (pk0, ck0, s1, v0) VALUES (true, 'C', 17, true) USING
> TIMESTAMP 5"));
> cluster.get(2).executeInternal(withKeyspace("UPDATE %s.single_static
> USING TIMESTAMP 6 SET s1 = 1, v0 = false WHERE pk0 = true AND ck0 = 'A'"));
> String selectPartition = withKeyspace("SELECT ck0 FROM
> %s.single_static WHERE pk0 = true");
> String select = withKeyspace("SELECT ck0 FROM %s.single_static WHERE
> s1 = 1 ALLOW FILTERING");
> SimpleQueryResult simplePartitionResult =
> cluster.coordinator(1).executeWithResult(selectPartition, ALL);
> SimpleQueryResult simpleResult =
> cluster.coordinator(1).executeWithResult(select, ALL);
> System.err.println("Non-paging partition result: " +
> simplePartitionResult);
> System.err.println("Non-paging filtering result: " + simpleResult);
> QueryResult partitionWithPagingResult =
> cluster.coordinator(1).executeWithPagingWithResult(selectPartition, ALL, 1);
> QueryResult saiWithPagingResult =
> cluster.coordinator(1).executeWithPagingWithResult(select, ALL, 1);
> System.err.println("Paging partition result: " +
> Iterators.toString(partitionWithPagingResult));
> System.err.println("Paging filtering result: " +
> Iterators.toString(saiWithPagingResult));
> assertEquals(4,
> Iterators.size(cluster.coordinator(1).executeWithPaging(selectPartition, ALL,
> 1)));
> assertRows(cluster.coordinator(1).executeWithPaging(select, ALL, 1),
> cluster.coordinator(1).executeWithPaging(selectPartition, ALL, 1));
> }
> Paging partition result: [Row{names=[ck0], results=[A]}, Row{names=[ck0],
> results=[C]}, Row{names=[ck0], results=[F]}, Row{names=[ck0], results=[G]}]
> Paging SAI result: [Row{names=[ck0], results=[A]}, Row{names=[ck0],
> results=[C]}, Row{names=[ck0], results=[G]}]
> java.lang.AssertionError: Expected: [F]
> Actual:[G]
> {noformat}
>
> The things that are worrisome here are the interaction of the static column,
> paging, and replica filtering protection. Disabling paging appears to pass
> the test, and either removing the first UPDATE or running the partition
> DELETE against node 3 also passes the test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]