adelapena commented on code in PR #2673:
URL: https://github.com/apache/cassandra/pull/2673#discussion_r1327723617


##########
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:
   And, since RFP is disabled for all the query, if we restrict any other 
column we can also return stale rows that don't satisfy that filter:
   ```java
   try (Cluster cluster = init(Cluster.build(2).start()))
   {
       cluster.schemaChange(withKeyspace("CREATE TABLE %s.t (k int PRIMARY KEY, 
v vector<float, 1>, c text)"));
       cluster.schemaChange(withKeyspace("CREATE CUSTOM INDEX ON %s.t(v) USING 
'StorageAttachedIndex'"));
       cluster.schemaChange(withKeyspace("CREATE CUSTOM INDEX ON %s.t(c) USING 
'StorageAttachedIndex'"));
   
       // insert a row in both nodes, and then update it in only one of the 
nodes
       cluster.coordinator(1).execute(withKeyspace("INSERT INTO %s.t (k, v, c) 
VALUES (1, [1], 'old')"), ConsistencyLevel.QUORUM);
       cluster.get(1).executeInternal(withKeyspace("UPDATE %s.t SET c='new' 
WHERE k=1"));
   
       String query = withKeyspace("SELECT * FROM %s.t WHERE c='old' ORDER BY v 
ANN OF [1] LIMIT 1");
       Object[][] rows = cluster.coordinator(1).execute(query, 
ConsistencyLevel.QUORUM);
       assertThat(rows).isEmpty(); // wrongly returns the stale row, (1, old, 
[1.0]), which doesn't satisfy the query
   }
   ```



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

Reply via email to