iamaleksey commented on code in PR #4541:
URL: https://github.com/apache/cassandra/pull/4541#discussion_r2673652353


##########
src/java/org/apache/cassandra/replication/TrackedWriteRequest.java:
##########
@@ -182,8 +226,11 @@ public static void applyLocallyAndSendToReplicas(Mutation 
mutation, ReplicaPlan.
             }
         }
 
-        Preconditions.checkState(applyLocally); // the coordinator is always a 
replica
-        applyMutationLocally(mutation, handler);
+        Preconditions.checkState(foundSelf, "Coordinator must be a replica");
+
+        // Notify handler that local write succeeded (mutation was already 
applied before calling this method)
+        if (notifyHandlerForLocal)

Review Comment:
   I believe it would be better to mimic, for counters, in 
`LocalCounterMutationRunnable#run()` to mimic what we do for regular mutations, 
and invoke `handler.onResponse(null)` there, instead of having it be done two 
different ways for regular- and counter mutations. I'd also rename the method 
to simply `sendToReplicas()` - 'only' is ambiguous here. 



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