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


##########
accord-core/src/main/java/accord/messages/ReadData.java:
##########
@@ -53,7 +54,35 @@ public static ReadData create(TxnId txnId, Seekables<?, ?> 
scope, long executeAt
             return new ReadData(txnId, scope, executeAtEpoch, waitForEpoch);
         }
     }
+    private class ObsoleteTracker implements CommandListener
+    {
+        @Override
+        public void onChange(SafeCommandStore safeStore, SafeCommand 
safeCommand)
+        {
+            switch (safeCommand.current().status())

Review Comment:
   good call... 
   
   if we reply back, the listener still exists (as we didn't remove) so the 
next step would trigger an obsolete reply; which would get ignored...
   
   We do the following on the `apply` failure case
   
   ```
   node.commandStores().mapReduceConsume(this, waitingOn.stream(), forEach(in 
-> removeListener(in, txnId), node.agent()));
   ```
   
   so could do the same in `ack`.
   
   Now, the better solution is to do the same, but switch from `boolean` to 
`enum`.  if we reply back *before* `PreAccept`, then that's fine... so we 
should ignore in that case
   
   ill look to improve this



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