Merge pull request #3635 from weaveworks/issue-3632

bump up the version of entry by large value so that transfer of range takes precedence
This commit is contained in:
Bryan Boreham authored and GitHub committed 2019-04-30 10:24:53 +01:00
commit 47d8f24e56
1 file changed
+3 -1
+3 -1
View File
@@ -565,7 +565,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
newRanges = append(newRanges, address.Range{Start: entry.Token, End: r.Entries.entry(i + 1).Token})
}
}