Force transferring of IPAM ranges in a case of Shutdown

If no peer for transfer is found, we transfer them to
mesh.UnknownPeerName to notify the ring update tracker.

Makes the awsvpc tracker to remove local entries from
the VPC route table when the last peer calls "weave reset".
This commit is contained in:
Martynas Pumputis committed 2016-06-10 11:51:31 +01:00
1 parent adcb1018df
commit 8569cbd4a3
1 file changed
+4 -3
+4 -3
View File
@@ -443,10 +443,11 @@ func (alloc *Allocator) Shutdown() {
alloc.cancelOps(&alloc.pendingClaims)
alloc.cancelOps(&alloc.pendingAllocates)
alloc.cancelOps(&alloc.pendingPrimes)
if heir := alloc.pickPeerForTransfer(); heir != mesh.UnknownPeerName {
alloc.ring.Transfer(alloc.ourName, heir)
heir := alloc.pickPeerForTransfer()
alloc.ring.Transfer(alloc.ourName, heir)
alloc.space.Clear()
if heir != mesh.UnknownPeerName {
alloc.persistRing()
alloc.space.Clear()
alloc.gossip.GossipBroadcast(alloc.Gossip())
}
doneChan <- struct{}{}