Skip to content

Commit

Permalink
refactor(raft): fix condition for skipping recovery in `recoverFromCo…
Browse files Browse the repository at this point in the history
…mmittedLogs`
  • Loading branch information
peterxcli committed Sep 18, 2024
1 parent e2617e8 commit 6daca47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,8 @@ func (r *Raft) recoverFromCommittedLogs() error {
if err != nil {
return fmt.Errorf("failed to read commit index from store: %w", err)
}
if commitIndex == 0 {
lastApplied := r.getLastApplied()
if commitIndex <= lastApplied {
return nil
}

Expand Down

0 comments on commit 6daca47

Please sign in to comment.