Remove debug print statements

This commit is contained in:
Preetha Appan
2018-04-10 08:16:50 -05:00
parent 5194f5d6c7
commit 37f80a9bdb
4 changed files with 5 additions and 38 deletions

View File

@@ -193,18 +193,13 @@ func (r *Raft) runFollower() {
if r.configurations.latestIndex == 0 {
if !didWarn {
r.logger.Printf("[WARN] raft: no known peers, aborting election")
//didWarn = true
didWarn = true
}
} else if r.configurations.latestIndex == r.configurations.committedIndex &&
!hasVote(r.configurations.latest, r.localID) {
if !didWarn {
r.logger.Printf("[WARN] raft: not part of stable configuration, aborting election: %v == %v && !%v", r.configurations.latestIndex, r.configurations.committedIndex, hasVote(r.configurations.latest, r.localID))
r.logger.Printf("ALEX: local ID: %v", r.localID)
for _, srv := range r.configurations.latest.Servers {
r.logger.Printf("ALEX: %+v", srv)
}
//didWarn = true
r.logger.Printf("[WARN] raft: not part of stable configuration, aborting election")
didWarn = true
}
} else {
r.logger.Printf(`[WARN] raft: Heartbeat timeout from %q reached, starting election`, lastLeader)
@@ -500,8 +495,6 @@ func (r *Raft) leaderLoop() {
// of peers.
stepDown := false
r.logger.Printf("ALEX: local ID as LEADER: %v", r.localID)
lease := time.After(r.conf.LeaderLeaseTimeout)
for r.getState() == Leader {
select {