Skip to content

Commit

Permalink
raft: set raft.Commit too when setting raftLog.committed
Browse files Browse the repository at this point in the history
  • Loading branch information
yichengq committed Dec 9, 2014
1 parent 1f323ed commit 1823b75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func StartNode(id uint64, peers []Peer, election, heartbeat int, storage Storage
// TODO(bdarnell): These entries are still unstable; do we need to preserve
// the invariant that committed < unstable?
r.raftLog.committed = r.raftLog.lastIndex()
r.Commit = r.raftLog.committed
// Now apply them, mainly so that the application can call Campaign
// immediately after StartNode in tests. Note that these nodes will
// be added to raft twice: here and when the application's Ready
Expand Down

0 comments on commit 1823b75

Please sign in to comment.