Merge branch '1.5'

This commit is contained in:
Matthias Radestock committed 2016-05-05 14:50:00 +01:00
commit 32ba82efaf
2 files changed
+4 -2

No files matched your search

+3 -2
View File
@@ -417,6 +417,7 @@ func (alloc *Allocator) Shutdown() {
alloc.cancelOps(&alloc.pendingPrimes)
if heir := alloc.pickPeerForTransfer(); heir != mesh.UnknownPeerName {
alloc.ring.Transfer(alloc.ourName, heir)
alloc.persistRing()
alloc.space.Clear()
alloc.gossip.GossipBroadcast(alloc.Gossip())
time.Sleep(100 * time.Millisecond)
@@ -454,7 +455,7 @@ func (alloc *Allocator) AdminTakeoverRanges(peerNameOrNickname string) address.C
}
before := alloc.space.NumFreeAddresses()
alloc.space.AddRanges(newRanges)
alloc.ringUpdated()
after := alloc.space.NumFreeAddresses()
alloc.gossip.GossipBroadcast(alloc.Gossip())
@@ -680,8 +681,8 @@ func (alloc *Allocator) establishRing() {
func (alloc *Allocator) createRing(peers []mesh.PeerName) {
alloc.debugln("Paxos consensus:", peers)
alloc.ring.ClaimForPeers(normalizeConsensus(peers))
alloc.gossip.GossipBroadcast(alloc.Gossip())
alloc.ringUpdated()
alloc.gossip.GossipBroadcast(alloc.Gossip())
}
func (alloc *Allocator) ringUpdated() {
+1
View File
@@ -176,6 +176,7 @@ func TestAllocatorClaim(t *testing.T) {
alloc.Prime()
// Do an allocate on the other peer, which we will try to claim later
addrx, err := allocs[0].Allocate(container1, subnet, true, returnFalse)
router.Flush()
// Now try the claim again
err = alloc.Claim(container3, addr1, true, true)