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 17:47:00 UTC

[jira] [Created] (RATIS-1216) State machine preAppend can throw exception without having leader to step down.

Aravindan Vijayan created RATIS-1216:
----------------------------------------

             Summary: State machine preAppend 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


{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}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)