Package io.microraft.exception
Class IndeterminateStateException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.microraft.exception.RaftException
-
- io.microraft.exception.IndeterminateStateException
-
- All Implemented Interfaces:
Serializable
public class IndeterminateStateException extends RaftException
A Raft leader may demote to the follower role after it appends an entry to its local Raft log, but before discovering its commit status. In some of these cases, which cause this exception to be thrown, it may happen that the Raft node cannot determine if the operation is committed or not. In this case, theCompletableFuture
objects returned for these operations are notified with this exception.It is up to the clients to decide on retry upon receiving this exception. If the operation is retried either on the same or different Raft node, it could be committed twice, hence causes at-least-once execution. On the contrary, if
RaftNode.replicate(Object)
is not called again, then at-most-once execution happens.Idempotent operations can be retried on indeterminate situations.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IndeterminateStateException()
IndeterminateStateException(RaftEndpoint leader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
toString()
-
Methods inherited from class io.microraft.exception.RaftException
getLeader
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
IndeterminateStateException
public IndeterminateStateException()
-
IndeterminateStateException
public IndeterminateStateException(RaftEndpoint leader)
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toString
in classRaftException
-
-