diff --git a/raft/fsm.cc b/raft/fsm.cc index 139953f27dc3..bf13e20e67ab 100644 --- a/raft/fsm.cc +++ b/raft/fsm.cc @@ -536,9 +536,11 @@ void fsm::tick_leader() { if (state.stepdown) { logger.trace("tick[{}]: stepdown is active", _my_id); - if (leader_state().tracker.find(_my_id) == nullptr) { + auto me = leader_state().tracker.find(_my_id); + if (me == nullptr || !me->can_vote) { // Do not abort stepdown if not part of the current - // config. + // config or non voting member since the node cannot + // be a leader any longer } else if (*state.stepdown <= _clock.now()) { logger.trace("tick[{}]: cancel stepdown", _my_id); // Cancel stepdown (only if the leader is part of the cluster) @@ -995,7 +997,8 @@ void fsm::send_timeout_now(server_id id) { logger.trace("send_timeout_now[{}] send timeout_now to {}", _my_id, id); send_to(id, timeout_now{_current_term}); leader_state().timeout_now_sent = id; - if (leader_state().tracker.find(_my_id) == nullptr) { + auto me = leader_state().tracker.find(_my_id); + if (me == nullptr || !me->can_vote) { logger.trace("send_timeout_now[{}] become follower", _my_id); become_follower({}); }