Broadcast initial ring after persisting it, in case we die between those operations
This commit is contained in:
1 parent
6847a3551d
commit
3252a25e00
2 files changed
+2
-1
No files matched your search
+1
-1
@@ -650,8 +650,8 @@ func (alloc *Allocator) establishRing() {
|
|||||||
func (alloc *Allocator) createRing(peers []mesh.PeerName) {
|
func (alloc *Allocator) createRing(peers []mesh.PeerName) {
|
||||||
alloc.debugln("Paxos consensus:", peers)
|
alloc.debugln("Paxos consensus:", peers)
|
||||||
alloc.ring.ClaimForPeers(normalizeConsensus(peers))
|
alloc.ring.ClaimForPeers(normalizeConsensus(peers))
|
||||||
alloc.gossip.GossipBroadcast(alloc.Gossip())
|
|
||||||
alloc.ringUpdated()
|
alloc.ringUpdated()
|
||||||
|
alloc.gossip.GossipBroadcast(alloc.Gossip())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (alloc *Allocator) ringUpdated() {
|
func (alloc *Allocator) ringUpdated() {
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ func TestAllocatorClaim(t *testing.T) {
|
|||||||
alloc.Prime()
|
alloc.Prime()
|
||||||
// Do an allocate on the other peer, which we will try to claim later
|
// Do an allocate on the other peer, which we will try to claim later
|
||||||
addrx, err := allocs[0].Allocate(container1, subnet, true, returnFalse)
|
addrx, err := allocs[0].Allocate(container1, subnet, true, returnFalse)
|
||||||
|
router.Flush()
|
||||||
|
|
||||||
// Now try the claim again
|
// Now try the claim again
|
||||||
err = alloc.Claim(container3, addr1, true, true)
|
err = alloc.Claim(container3, addr1, true, true)
|
||||||
|
|||||||
Reference in new issue
Block a user