Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.0
-
None
Description
try { state.appendLog(context); } catch (StateMachineException e) { // the StateMachineException is thrown by the SM in the preAppend stage. // Return the exception in a RaftClientReply. RaftClientReply exceptionReply = newExceptionReply(request, e); cacheEntry.failWithReply(exceptionReply); // leader will step down here if (getInfo().isLeader()) { leaderState.submitStepDownEvent(LeaderState.StepDownReason.STATE_MACHINE_EXCEPTION); } return CompletableFuture.completedFuture(exceptionReply); }
The state machine can throw a StateMachine exception, which has a flag to disable leader step down action. The default for this flag would be true.