Initialize Paxos quorum to 0 until this node needs to request consensus.

With a 0 quorum we will participate in voting, but will not actively
try to form a ring.
This commit is contained in:
Bryan Boreham committed 2016-04-11 11:42:24 +01:00
1 parent 16e5032528
commit ecf1887e5b
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -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,
+3
View File
@@ -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 {