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


##########
src/java/org/apache/cassandra/service/consensus/TransactionalMode.java:
##########
@@ -112,14 +121,25 @@ public ConsistencyLevel 
commitCLForStrategy(ConsistencyLevel consistencyLevel)
         return consistencyLevel;
     }
 
-    // TODO (required): This won't work for migration directly from none to 
full because there is no safe system to read from
-    // during the first phase (repair). Accord won't read correctly beacuse it 
won't honor the CL and miss non-transactional writes that haven't been repaired 
and non-transactional
-    // reads will miss all the writes being routed through Accord since they 
occur asynchronously. Something has to give here where either writes routed 
through are Accord are synchronous at CL
-    // or reads are routed through Accord and read at quorum as long as the 
range has not completed the first phase (repair).
-    public ConsistencyLevel readCLForStrategy(ConsistencyLevel 
consistencyLevel)
+    private boolean ignoresSuppliedReadCL()
     {
-        if (ignoresSuppliedConsistencyLevel)
-            return null;
+        return writesThroughAccord && blockingReadRepairThroughAccord;
+    }
+
+    public ConsistencyLevel readCLForStrategy(TransactionalMigrationFromMode 
fromMode, ConsistencyLevel consistencyLevel, ClusterMetadata cm, TableId 
tableId, Token token)
+    {
+        if (ignoresSuppliedReadCL())
+        {
+            TableMigrationState tms = 
cm.consensusMigrationState.tableStates.get(tableId);
+            checkState(tms != null || fromMode == 
TransactionalMigrationFromMode.none);

Review Comment:
   Whether it's true is an artifact of how modifying the migration mode works 
and yes it's true. If you alter a table to start migration a 
`TableMigrationState` is created.
   
   Before you could have a table that the table params said was migrating, but 
there would be no table migration state and it was more unwieldy to deal with 
because you always had to remember to check both the table parameters and the 
table migration state to know what was going on.



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