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
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, the
CompletableFuture
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:
-
Constructor Summary
ConstructorDescriptionCreates an instance of the exception.Creates an instance of the exception. -
Method Summary
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 Details
-
IndeterminateStateException
public IndeterminateStateException()Creates an instance of the exception. -
IndeterminateStateException
Creates an instance of the exception. The leader endpoint can be passed if it is known.- Parameters:
leader
- the leader endpoint if it is known, null otherwise
-
-
Method Details
-
toString
- Overrides:
toString
in classRaftException
-