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


##########
src/java/org/apache/cassandra/db/Keyspace.java:
##########
@@ -404,9 +404,17 @@ public void initCf(TableMetadata metadata, boolean 
loadSSTables)
 
     public Future<?> applyFuture(Mutation mutation, boolean writeCommitLog, 
boolean updateIndexes)
     {
-        return MigrationRouter.isFullyTracked(mutation)
-             ? applyInternalTracked(mutation, new AsyncPromise<>())
-             : applyInternal(mutation, writeCommitLog, updateIndexes, true, 
true, new AsyncPromise<>());
+        MigrationRouter.MutationRouting routing = 
MigrationRouter.getMutationRouting(mutation);
+        switch (routing)
+        {
+            case UNTRACKED:
+                return applyInternal(mutation, writeCommitLog, updateIndexes, 
true, true, new AsyncPromise<>());
+            case TRACKED:
+                return applyInternalTracked(mutation, new AsyncPromise<>());
+            case MIXED:

Review Comment:
   Once we've gotten here we expect the logic higher up the call stack to have 
properly separated the mutation into tracked and untracked. That said, there is 
a race where things may have changed during the processing of the mutation. 
However, not doing this creates a possible (albeit unlikely) race where we 
apply an untracked mutation to a tracked keyspace, which will create a read 
monotonicity correctness issue.



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