Persist the ring in Shutdown() and AdminTakeoverRanges().

Also make AdminTakeoverRanges cause pending ops to be retried.
This commit is contained in:
Bryan Boreham committed 2016-05-03 17:23:00 +01:00
1 parent 8405e0759a
commit 6847a3551d
1 file changed
+2 -1
+2 -1
View File
@@ -402,6 +402,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)
@@ -439,7 +440,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())