adelapena commented on code in PR #2673:
URL: https://github.com/apache/cassandra/pull/2673#discussion_r1327696483
##########
src/java/org/apache/cassandra/service/reads/DataResolver.java:
##########
@@ -135,6 +135,9 @@ private boolean needsReplicaFilteringProtection()
if (command.rowFilter().isEmpty())
return false;
+ if (command.isTopK())
+ return false;
Review Comment:
Here is a dtest showing how a vector search with CL>ONE can wrongly return a
row that has been deleted:
```java
try (Cluster cluster = init(Cluster.build(2).withConfig(config ->
config.with(GOSSIP, NETWORK)).start()))
{
cluster.schemaChange(withKeyspace("CREATE TABLE %s.t (k int PRIMARY KEY,
v vector<float, 1>)"));
cluster.schemaChange(withKeyspace("CREATE CUSTOM INDEX ON %s.t(v) USING
'StorageAttachedIndex'"));
SAIUtil.waitForIndexQueryable(cluster, KEYSPACE);
// insert a row in both nodes, and then remove in only one of the nodes
cluster.coordinator(1).execute(withKeyspace("INSERT INTO %s.t (k, v)
VALUES (1, [1])"), ConsistencyLevel.QUORUM);
cluster.get(1).executeInternal(withKeyspace("DELETE FROM %s.t WHERE
k=1"));
String query = withKeyspace("SELECT * FROM %s.t ORDER BY v ANN OF [1]
LIMIT 10");
Object[][] rows = cluster.coordinator(1).execute(query,
ConsistencyLevel.QUORUM);
assertThat(rows).isEmpty(); // wrongly returns the deleted row
}
```
This other
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]