aweisberg commented on code in PR #3694:
URL: https://github.com/apache/cassandra/pull/3694#discussion_r1848870380


##########
src/java/org/apache/cassandra/service/accord/interop/AccordInteropExecution.java:
##########
@@ -290,6 +291,66 @@ private AsyncChain<Data> readChains()
                 }));
             });
         });
+        return results;
+    }
+
+    private List<AsyncChain<Data>> rangeReadChains(long nowInSeconds, 
Dispatcher.RequestTime requestTime)
+    {
+        TxnRangeRead read = (TxnRangeRead) txn.read();
+        Seekables<?, ?> keys = txn.read().keys();
+        List<AsyncChain<Data>> results = new ArrayList<>();
+        keys.forEach(key -> {
+            TokenRange range = (TokenRange)key;
+            PartitionRangeReadCommand command = read.commandForSubrange(range, 
nowInSeconds);
+
+            // This should only rarely occur when coordinators start a 
transaction in a migrating range
+            // because they haven't yet updated their cluster metadata.
+            // It would be harmless to do the read, because it will be 
rejected in `TxnQuery` anyways,
+            // but it's faster to skip the read
+            // TODO (required): To make migration work we need to validate 
that the range is all on Accord
+            // if any part isn't we should reject the read
+//                TableMigrationState tms = 
ConsensusTableMigration.getTableMigrationState(command.metadata().id);
+//                AccordClientRequestMetrics metrics = txn.kind().isWrite() ? 
accordWriteMetrics : accordReadMetrics;
+//                if 
(ConsensusRequestRouter.instance.isKeyInMigratingOrMigratedRangeFromAccord(command.metadata(),
 tms, command.partitionKey()))
+//                {
+//                    metrics.migrationSkippedReads.mark();
+//                    
results.add(AsyncChains.success(TxnData.emptyPartition(fragment.txnDataName(), 
command)));
+//                    return;
+//                }
+
+            
results.add(AsyncChains.ofCallable(Stage.ACCORD_MIGRATION.executor(), () -> {
+                TxnData result = new TxnData();
+                try (PartitionIterator iterator = 
StorageProxy.getRangeSlice(command, consistencyLevel, this, requestTime))

Review Comment:
   Interop execution goes through `StorageProxy` and *all* the Cassandra read 
coordination code, but proxies the read through Accord in the context of this 
specific transaction using `ReadCoordinator` which is passed to the classic 
Cassandra read path which decides which nodes to read from, does read repair, 
short read protection, filtering, etc. everything involved in a C* classic 
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