Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allocator: Avoid assigning duplicate IPs during initialization #2237

Merged
merged 1 commit into from
Jun 12, 2017

Commits on Jun 10, 2017

  1. allocator: Avoid assigning duplicate IPs during initialization

    When the allocator starts up, there is a pass that "allocates" the
    existing tasks/nodes/services in the store. In fact, existing tasks are
    typically already allocated, and this is mostly populating local state
    to reflect which IPs are taken. However, if there are any tasks in the
    store which are brand new, or previously failed to allocated, these will
    actually receive new allocations.
    
    The problem is that allocation of new IPs is interspersed with updating
    local state with existing IPs. If a task, node, or service that needs an
    IP is processed before one that claims a specific IP, the IP claimed by
    the latter task be assigned.
    
    This change makes the allocator do two passes on initialization. First
    it handles objects that claim a specific IP, then it handles all other
    objects.
    
    Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
    aaronlehmann committed Jun 10, 2017
    Configuration menu
    Copy the full SHA
    61483fb View commit details
    Browse the repository at this point in the history