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


##########
src/java/org/apache/cassandra/db/AbstractMutationVerbHandler.java:
##########
@@ -51,7 +53,15 @@ public abstract class AbstractMutationVerbHandler<T extends 
IMutation> implement
 
     public void doVerb(Message<T> message) throws IOException
     {
-        processMessage(message, message.respondTo());
+        try
+        {
+            processMessage(message, message.respondTo());
+        }
+        catch (IllegalReplicationTypeException e)
+        {
+            // retry, write may be recoverable if TCM is behind locally
+            doVerb(message);

Review Comment:
   This is kind of confusing because if we get this exception it means we got 
all the way into Keyspace to apply the mutation so we had an epoch that thought 
the coordinator was correct initially, but then we acquired an epoch where that 
wasn't the case anymore. So it goes into doVerb again with the real goal being 
to throw CoordinatorBehindException?
   
   I don't think the write would be recoverable in the sense of we will apply 
here (since it doesn't switch the type of the mutation's replication) but it's 
recoverable in the sense of if we signal to the coordinator we aren't going to 
do it (via CoordinatorBehindException) then it will retry.
   
   So maybe just update the comment to highlight the goal of throwing 
CoordinatorBehindException so the coordinator retries?
   
   Really I would just throw CoordinatorBehindException from inside the the 
write order instead of introducing IllegalReplicationTypeException because I 
think IRL it doesn't happen that we retry here and it succeeds. That would 
require a flip flop of the migration direction which seems really unlikely so 
better to keep it simple and just throw an error straight back to the 
coordinator.



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