Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request goraft#164 from xiangli-cmu/bug_fix
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
benbjohnson committed Jan 23, 2014
2 parents b5dbd6e + 2987111 commit 3a5d909
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion peer.go
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server.go
Expand Up @@ -33,7 +33,7 @@ const (
)

const (
DefaultHeartbeatTimeout = 1 * time.Millisecond
DefaultHeartbeatTimeout = 50 * time.Millisecond
DefaultElectionTimeout = 150 * time.Millisecond
)

Expand Down

0 comments on commit 3a5d909

Please sign in to comment.