You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Aravindan Vijayan (Jira)" <ji...@apache.org> on 2020/12/07 18:03:00 UTC
[jira] [Updated] (RATIS-1216) State machine preAppend callback can
throw exception without having leader to step down.
[ https://issues.apache.org/jira/browse/RATIS-1216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aravindan Vijayan updated RATIS-1216:
-------------------------------------
Summary: State machine preAppend callback can throw exception without having leader to step down. (was: State machine preAppend can throw exception without having leader to step down.)
> State machine preAppend callback can throw exception without having leader to step down.
> ----------------------------------------------------------------------------------------
>
> Key: RATIS-1216
> URL: https://issues.apache.org/jira/browse/RATIS-1216
> Project: Ratis
> Issue Type: Bug
> Affects Versions: 1.1.0
> Reporter: Aravindan Vijayan
> Priority: Major
>
> {code}
> 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);
> }
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)