You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "dcapwell (via GitHub)" <gi...@apache.org> on 2023/04/04 21:56:52 UTC

[GitHub] [cassandra-accord] dcapwell commented on a diff in pull request #40: CASSANDRA-18422: when status changes after read result, reject

dcapwell commented on code in PR #40:
URL: https://github.com/apache/cassandra-accord/pull/40#discussion_r1157807404


##########
accord-core/src/main/java/accord/messages/ReadData.java:
##########
@@ -219,12 +248,22 @@ private void ack()
         // and prevents races where we respond before dispatching all the required reads (if the reads are
         // completing faster than the reads can be setup on all required shards)
         if (-1 == --waitingOnCount)
-            node.reply(replyTo, replyContext, new ReadOk(data));
+        {
+            if (isObsolete)
+            {
+                logger.debug("After the read completed for txn {}, the result was marked obsolete", txnId);
+                node.reply(replyTo, replyContext, Redundant);
+            }
+            else
+            {
+                node.reply(replyTo, replyContext, new ReadOk(data));
+            }
+        }
     }
 
     private synchronized void readComplete(CommandStore commandStore, Data result)
     {
-        Invariants.checkState(waitingOn.get(commandStore.id()), "Waiting on does not contain store %d; waitingOn=%s", commandStore.id(), waitingOn);
+        Invariants.checkState(waitingOn.get(commandStore.id()), "Txn %s's waiting on does not contain store %d; waitingOn=%s", txnId, commandStore.id(), waitingOn);

Review Comment:
   fixed by https://issues.apache.org/jira/browse/CASSANDRA-18364



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org