raft: add Id to Entry

This commit is contained in:
Blake Mizerany
2014-08-26 16:19:49 -07:00
committed by Yicheng Qin
parent 3dd6280df5
commit 225e618b8f
5 changed files with 41 additions and 28 deletions

View File

@ -110,8 +110,8 @@ func (n *Node) Tick() error {
}
// Propose proposes data be appended to the log.
func (n *Node) Propose(ctx context.Context, data []byte) error {
return n.Step(ctx, []Message{{Type: msgProp, Entries: []Entry{{Data: data}}}})
func (n *Node) Propose(ctx context.Context, id int64, data []byte) error {
return n.Step(ctx, []Message{{Type: msgProp, Entries: []Entry{{Id: id, Data: data}}}})
}
// Step advances the state machine using msgs. Proposals are priotized last so