From 70bc87c5d386e5a4fe6c045becd3b773c52fa03b Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Fri, 18 Oct 2024 09:20:20 -0400 Subject: [PATCH] Revert changes to leader loop --- raft.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/raft.go b/raft.go index 49ab67b0..6bdf0444 100644 --- a/raft.go +++ b/raft.go @@ -688,7 +688,7 @@ func (r *Raft) leaderLoop() { // Track whether leadership has been asserted. This becomes true once // the leader has committed at least one log in this term. - leadershipAsserted := false + //leadershipAsserted := false for r.getState() == Leader { r.mainThreadSaturation.sleeping() @@ -802,7 +802,7 @@ func (r *Raft) leaderLoop() { oldCommitIndex := r.getCommitIndex() commitIndex := r.leaderState.commitment.getCommitIndex() r.setCommitIndex(commitIndex) - leadershipAsserted = true + //leadershipAsserted = true // New configuration has been committed, set it as the committed // value. @@ -884,11 +884,11 @@ func (r *Raft) leaderLoop() { v.respond(nil) } - case v := <-r.assertedCh: - r.mainThreadSaturation.working() - v.asserted = leadershipAsserted - v.term = r.getCurrentTerm() - v.respond(nil) + // case v := <-r.assertedCh: + // r.mainThreadSaturation.working() + // v.asserted = leadershipAsserted + // v.term = r.getCurrentTerm() + // v.respond(nil) case future := <-r.userRestoreCh: r.mainThreadSaturation.working()