Skip to content

Commit

Permalink
r/consensus: try updating leader commit index after aborting config c…
Browse files Browse the repository at this point in the history
…hange

When configuration change is aborted we append simple configuration
entry to each raft group member log. If node is a leader we must try to
update the committed index. For single replica raft groups that is the
only way to make the committed offset progress and finish
reconfiguration.

Updating committed offset is possible for single replica raft groups as
the node is the only source of truth for all raft decisions hence an
entry appended to leader log may immediately be committed.

Fixes: #5338

Signed-off-by: Michal Maslanka <michal@redpanda.com>
  • Loading branch information
mmaslankaprv committed Jul 5, 2022
1 parent 7d762f7 commit 48edc4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/v/raft/consensus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,12 @@ consensus::abort_configuration_change(model::revision_id revision) {
append_result.base_offset);
// flush log as all configuration changes must eventually be committed.
co_await flush_log();
// if current node is a leader make sure we will try to update committed
// index, it may be required for single participant raft groups
if (is_leader()) {
maybe_update_majority_replicated_index();
maybe_update_leader_commit_idx();
}
co_return errc::success;
}

Expand Down

0 comments on commit 48edc4f

Please sign in to comment.