ifesdjeen commented on code in PR #243:
URL: https://github.com/apache/cassandra-accord/pull/243#discussion_r2285343240
##########
accord-core/src/main/java/accord/coordinate/ExecuteTxn.java:
##########
@@ -258,8 +387,22 @@ protected void onDone(Success success, Throwable failure)
}
else
{
- if (!hasInformedDecidedOrSucceeded && stable.hasReachedQuorum())
- informStable();
+ stable.informStableOnceQuorum();
+ if (sendOnlyReadStableMessages())
+ {
+ // send additional stable messages to record the transaction
outcome
+ Commit.Kind kind = commitKind();
+ if (!candidates.isEmpty())
+ {
+ for (int i = 0, size = candidates.size() ; i < size ; ++i)
+ sendStableOnly(candidates.get(i), kind);
+ }
+ if (unstableFastReads != null && sendOnlyReadStableMessages())
Review Comment:
nit: covered by the above if
##########
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();
Review Comment:
looks like we might be able to call `informStable` more Ethan once as nodes
keep responding after reaching quorum. Should we call it just once to avoid
sending InformDurable more than once?
--
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]