maedhroz commented on code in PR #3890: URL: https://github.com/apache/cassandra/pull/3890#discussion_r1951923975
########## test/distributed/org/apache/cassandra/distributed/test/sai/StrictFilteringTest.java: ########## @@ -51,6 +50,25 @@ public static void setUpCluster() throws IOException CLUSTER = init(Cluster.build(2).withConfig(config -> config.set("hinted_handoff_enabled", false).with(GOSSIP).with(NETWORK)).start()); } + @Test + public void testMissingStaticRowWithNonStaticExpression() + { + CLUSTER.schemaChange(withKeyspace("CREATE TABLE %s.single_predicate (pk0 int, ck0 int, ck1 int, s0 int static, s1 int static, v0 int, PRIMARY KEY (pk0, ck0, ck1)) " + + "WITH CLUSTERING ORDER BY (ck0 ASC, ck1 DESC) AND read_repair = 'NONE'")); + CLUSTER.schemaChange(withKeyspace("CREATE INDEX ON %s.single_predicate(ck1) USING 'sai'")); + + CLUSTER.get(1).executeInternal(withKeyspace("INSERT INTO %s.single_predicate (pk0, ck0, ck1, s0, s1, v0) " + + "VALUES (0, 1, 2, 3, 4, 5) USING TIMESTAMP 1")); + CLUSTER.get(2).executeInternal(withKeyspace("UPDATE %s.single_predicate USING TIMESTAMP 2 SET s0 = 6, s1 = 7, v0 = 8 " + + "WHERE pk0 = 0 AND ck0 = 9 AND ck1 = 10")); + + // Node 2 will not produce a match for the static row. Make sure that replica filtering protection does not + // fetch the entire partition, which could let non-matching rows slip through combined with the fact that we + // don't post-filter at the coordinator with no regular column predicates in the query. + String select = withKeyspace("SELECT pk0, ck0, ck1, s0, s1 FROM %s.single_predicate WHERE ck1 = 2 ALLOW FILTERING"); + assertRows(CLUSTER.coordinator(1).execute(select, ConsistencyLevel.ALL), row(0, 1, 2, 6, 7)); Review Comment: One thing to note here is that we still get the updated static column values, because node 2 doesn't produce a match for ck1 = 2, and that means we have an unresolved row, and any unresolved row implicitly reads the static row during its RFP completion. (See https://github.com/apache/cassandra/pull/3890/files#r1951922090( -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org