diff --git a/peer.go b/peer.go index 55893efd04..3de465960d 100644 --- a/peer.go +++ b/peer.go @@ -192,7 +192,7 @@ func (p *Peer) sendAppendEntriesRequest(req *AppendEntriesRequest) { // If it was unsuccessful then decrement the previous log index and // we'll try again next time. } else { - if resp.Term() > p.server.Term() { + if resp.Term() > p.server.Term() || resp.CommitIndex() > p.server.CommitIndex() { // this happens when there is a new leader comes up that this *leader* has not // known yet. // this server can know until the new leader send a ae with higher term diff --git a/server.go b/server.go index b71c53a155..b3529bd979 100644 --- a/server.go +++ b/server.go @@ -33,7 +33,7 @@ const ( ) const ( - DefaultHeartbeatTimeout = 1 * time.Millisecond + DefaultHeartbeatTimeout = 50 * time.Millisecond DefaultElectionTimeout = 150 * time.Millisecond )