Fix leader id initialization.
parent
369ead2cc9
commit
75450466a6
|
@ -185,8 +185,6 @@ func (h *Handler) servePing(w http.ResponseWriter, r *http.Request) {
|
|||
log.Printf("unable to write client config: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
// error writes an error to the client and sets the status code.
|
||||
|
|
|
@ -513,6 +513,7 @@ func (l *Log) Initialize() error {
|
|||
l.term = term
|
||||
l.votedFor = 0
|
||||
l.lastLogTerm = term
|
||||
l.leaderID = l.id
|
||||
|
||||
// Begin state loop as leader.
|
||||
l.startStateLoop(l.closing, Leader)
|
||||
|
|
Loading…
Reference in New Issue