diff --git a/ipam/allocator.go b/ipam/allocator.go index 20c78bd5..85b79f35 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -86,7 +86,7 @@ func NewAllocator(config Config) *Allocator { if config.IsObserver { participant = paxos.NewObserver() } else { - participant = paxos.NewNode(config.OurName, config.OurUID, 1) + participant = paxos.NewNode(config.OurName, config.OurUID, 0) } return &Allocator{ ourName: config.OurName, diff --git a/ipam/paxos/paxos.go b/ipam/paxos/paxos.go index fe10775b..4a2a53c1 100644 --- a/ipam/paxos/paxos.go +++ b/ipam/paxos/paxos.go @@ -241,6 +241,9 @@ func (node *Node) pickValue() Value { // Has a consensus been reached, based on the known claims of other nodes? func (node *Node) Consensus() (bool, AcceptedValue) { + if node.quorum == 0 { + return false, AcceptedValue{} + } counts := map[ProposalID]uint{} for _, claims := range node.knows {