From 3c3e30a30e7636876dd12e8a079b205e4dcad3ba Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Wed, 7 Sep 2022 11:09:00 +0200 Subject: [PATCH] Revert "raft: directly update leader in advance" This reverts commit d73a986e4edb15ef9dbfc994f1cbf5e96694d877, which was added only for benchmarking purposes. Signed-off-by: Tobias Grieger --- raft/raft.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/raft/raft.go b/raft/raft.go index 405bc4fe8..cd4a604e9 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -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