clarify comment

This commit is contained in:
Alex Dadgar 2018-04-25 15:03:30 -07:00 committed by Preetha Appan
parent 768fec8505
commit c6478d9469
No known key found for this signature in database
GPG Key ID: 9F7C19990A50EAFC
1 changed files with 5 additions and 2 deletions

View File

@ -507,8 +507,11 @@ func (a *allocNameIndex) NextCanaries(n uint, existing, destructive allocSet) []
}
// We have exhausted the preferred and free set. Pick starting from n to
// n+remainder, to avoid overlapping where possible.
// indexes
// n+remainder, to avoid overlapping where possible. An example is the
// desired count is 3 and we want 5 canaries. The first 3 canaries can use
// index [0, 1, 2] but after that we prefer picking indexes [4, 5] so that
// we do not overlap. Once the canaries are promoted, these would be the
// allocations that would be shut down as well.
for i := uint(a.count); i < uint(a.count)+remainder; i++ {
name := structs.AllocName(a.job, a.taskGroup, i)
next = append(next, name)