raft: abort applier fiber when a state machine aborts

After 5badf20c7a applier fiber does not
stop after it gets abort error from a state machine which may trigger an
assertion because previous batch is not applied. Fix it.

Fixes #12863

(cherry picked from commit 9bdef9158e)
This commit is contained in:
Gleb Natapov
2023-02-15 15:44:23 +02:00
committed by Avi Kivity
parent c49fd6f176
commit 363ea87f51

View File

@@ -1144,7 +1144,7 @@ future<> server_impl::applier_fiber() {
co_await _state_machine->apply(std::move(commands));
} catch (abort_requested_exception& e) {
logger.info("[{}] applier fiber stopped because state machine was aborted: {}", _id, e);
co_return;
throw stop_apply_fiber{};
} catch (...) {
std::throw_with_nested(raft::state_machine_error{});
}