mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: forbid to use none as id
This commit is contained in:
parent
79689872af
commit
9793c518ab
@ -141,6 +141,9 @@ type stateMachine struct {
|
||||
}
|
||||
|
||||
func newStateMachine(id int64, peers []int64) *stateMachine {
|
||||
if id == none {
|
||||
panic("cannot use none id")
|
||||
}
|
||||
sm := &stateMachine{id: id, lead: none, log: newLog(), ins: make(map[int64]*index)}
|
||||
for _, p := range peers {
|
||||
sm.ins[p] = &index{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user