Skip to content

Commit

Permalink
Revert "raft: directly update leader in advance"
Browse files Browse the repository at this point in the history
This reverts commit d73a986, which
was added only for benchmarking purposes.

Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
  • Loading branch information
tbg committed Sep 20, 2022
1 parent 67c3522 commit 3c3e30a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,11 +576,11 @@ func (r *raft) advance(rd Ready) {
// The leader needs to self-ack the entries just appended (since it doesn't
// send an MsgApp to itself). This is roughly equivalent to:
//
r.prs.Progress[r.id].MaybeUpdate(e.Index)
if r.maybeCommit() {
r.bcastAppend()
}
// _ = r.Step(pb.Message{From: r.id, Type: pb.MsgAppResp, Index: e.Index})
// r.prs.Progress[r.id].MaybeUpdate(e.Index)
// if r.maybeCommit() {
// r.bcastAppend()
// }
_ = r.Step(pb.Message{From: r.id, Type: pb.MsgAppResp, Index: e.Index})
}
// NB: it's important for performance that this call happens after
// r.Step above on the leader. This is because r.Step can then use
Expand Down

0 comments on commit 3c3e30a

Please sign in to comment.