ifesdjeen commented on code in PR #243:
URL: https://github.com/apache/cassandra-accord/pull/243#discussion_r2285292003


##########
accord-core/src/main/java/accord/coordinate/ExecuteTxn.java:
##########
@@ -78,12 +86,63 @@
 import static accord.primitives.SaveStatus.Stable;
 import static accord.primitives.Status.Durability.DurablyStable;
 import static accord.primitives.Status.Phase.Execute;
+import static accord.topology.Topologies.SelectNodeOwnership.SHARE;
 import static java.util.concurrent.TimeUnit.MICROSECONDS;
 
 // TODO (expected): return Waiting from ReadData if not ready to execute, and 
do not submit more than one speculative retry in this case
 // TODO (expected): by default, if we can execute locally, never contact a 
remote replica regardless of local outcome
 public class ExecuteTxn extends ReadCoordinator<ReadReply>
 {
+    class StableTracker extends QuorumIdTracker implements Callback<ReadReply>
+    {
+        private boolean hasInformedDecidedOrSucceeded;
+        private boolean informOnSuccess;
+
+        public StableTracker(Topologies topologies)
+        {
+            super(topologies);
+        }
+
+        @Override
+        public void onSuccess(Id from, ReadReply reply)
+        {
+            if ((reply.isOk() || reply == Waiting) && RequestStatus.Success == 
recordSuccess(from) && informOnSuccess)
+                informStable();
+        }
+
+        @Override
+        public void onFailure(Id from, Throwable failure)
+        {
+        }
+
+        void informStable()
+        {
+            Invariants.require(hasReachedQuorum());
+            hasInformedDecidedOrSucceeded = true;

Review Comment:
   nit: should this call `setSucceeded`? 



-- 
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-unsubscr...@cassandra.apache.org

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


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

Reply via email to