Merge branch '2.5'

This commit is contained in:
Bryan Boreham committed 2019-05-07 13:32:55 +00:00
commit 27848992b1
6 files changed
+23 -14

No files matched your search

+1
View File
@@ -910,6 +910,7 @@ func (alloc *Allocator) donateSpace(r address.Range, to mesh.PeerName) {
alloc.debugln("Giving range", chunk, "to", to)
alloc.ring.GrantRangeToHost(chunk.Start, chunk.End, to)
alloc.persistRing()
alloc.gossip.GossipBroadcast(alloc.Gossip())
}
func (alloc *Allocator) assertInvariants() {
+3 -1
View File
@@ -568,7 +568,9 @@ func (r *Ring) Transfer(from, to mesh.PeerName) []address.Range {
for i, entry := range r.Entries {
if entry.Peer == from {
entry.Peer = to
entry.Version++
// bump version by large value so that transfer of range takes precedence (if there is any conflict in merging entry)
// over other opertaions on the entry that increments the version
entry.Version = entry.Version + 100
common.Log.Debugln(fmt.Sprintf("[ring %s]: Transfer token=%s from=%s to=%s version=%s", r.Peer, entry.Token, from, to, fmt.Sprint(entry.Version)))
newRanges = append(newRanges, address.Range{Start: entry.Token, End: r.Entries.entry(i + 1).Token})
}