Skip to content

Commit

Permalink
Merge pull request #315 from mmaslankaprv/recovery-state-update-fix
Browse files Browse the repository at this point in the history
r/consensus: fixed updating follower state when its data were deleted
  • Loading branch information
mmaslankaprv committed Dec 21, 2020
2 parents ec8fd30 + cb6db32 commit be35da8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/v/raft/consensus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ consensus::success_reply consensus::update_follower_index(
// we are already recovering, if follower dirty log index moved back
// from some reason (i.e. truncation, data loss, trigger recovery)
if (idx.last_dirty_log_index > reply.last_dirty_log_index) {
// update follower state to allow recovery of follower with
// missing entries
idx.last_dirty_log_index = reply.last_dirty_log_index;
idx.last_committed_log_index = reply.last_committed_log_index;
idx.next_index = details::next_offset(idx.last_dirty_log_index);
idx.follower_state_change.broadcast();
}
Expand Down

0 comments on commit be35da8

Please sign in to comment.