This is an automated email from the ASF dual-hosted git repository.

benedict pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-accord.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 9ccc44c7 Avoid calculating rejectsFastPath in more cases; delay retry 
of fetchMajorityDeps
9ccc44c7 is described below

commit 9ccc44c7f2f6b3bbbfcf7b4858de5edae2b41e96
Author: Benedict Elliott Smith <[email protected]>
AuthorDate: Thu Oct 10 10:00:48 2024 +0100

    Avoid calculating rejectsFastPath in more cases; delay retry of 
fetchMajorityDeps
---
 accord-core/src/main/java/accord/local/CommandStore.java     | 5 ++++-
 accord-core/src/main/java/accord/messages/BeginRecovery.java | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/accord-core/src/main/java/accord/local/CommandStore.java 
b/accord-core/src/main/java/accord/local/CommandStore.java
index 5a4d17f9..6b4a0aea 100644
--- a/accord-core/src/main/java/accord/local/CommandStore.java
+++ b/accord-core/src/main/java/accord/local/CommandStore.java
@@ -43,6 +43,7 @@ import java.util.NavigableMap;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.Callable;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Consumer;
 import java.util.function.Function;
@@ -476,6 +477,7 @@ public abstract class CommandStore implements AgentExecutor
         };
     }
 
+    // TODO (required): replace with a simple wait on suitable exclusive sync 
point(s)
     private void fetchMajorityDeps(AsyncResults.SettableResult<Void> 
coordination, Node node, long epoch, Ranges ranges)
     {
         TxnId id = TxnId.fromValues(epoch - 1, 0, node.id());
@@ -485,7 +487,8 @@ public abstract class CommandStore implements AgentExecutor
         CollectCalculatedDeps.withCalculatedDeps(node, id, route, route, 
before, (deps, fail) -> {
             if (fail != null)
             {
-                fetchMajorityDeps(coordination, node, epoch, ranges);
+                node.agent().onUncaughtException(fail);
+                node.scheduler().once(() -> fetchMajorityDeps(coordination, 
node, epoch, ranges), 1L, TimeUnit.MINUTES);
             }
             else
             {
diff --git a/accord-core/src/main/java/accord/messages/BeginRecovery.java 
b/accord-core/src/main/java/accord/messages/BeginRecovery.java
index ad8bb5a0..42c95d45 100644
--- a/accord-core/src/main/java/accord/messages/BeginRecovery.java
+++ b/accord-core/src/main/java/accord/messages/BeginRecovery.java
@@ -47,6 +47,7 @@ import static 
accord.local.SafeCommandStore.TestStatus.IS_STABLE;
 import static accord.local.SafeCommandStore.TestStatus.IS_PROPOSED;
 import static accord.local.SafeCommandStore.TestStartedAt.STARTED_AFTER;
 import static accord.local.SafeCommandStore.TestStartedAt.STARTED_BEFORE;
+import static accord.primitives.Status.Accepted;
 import static accord.primitives.Status.Phase;
 import static accord.primitives.Status.PreAccepted;
 import static accord.primitives.Status.PreCommitted;
@@ -130,7 +131,7 @@ public class BeginRecovery extends 
TxnRequest.WithUnsynced<BeginRecovery.Recover
         boolean rejectsFastPath;
         Deps earlierCommittedWitness, earlierAcceptedNoWitness;
 
-        if (command.hasBeen(PreCommitted))
+        if (command.hasBeen(Accepted))
         {
             rejectsFastPath = false;
             earlierCommittedWitness = earlierAcceptedNoWitness = Deps.NONE;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to