Comment 7 for bug 1729371

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/pike)

Reviewed: https://review.openstack.org/517879
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=70ef1fa159c9941129827dbe93d4acc718fdb7ad
Submitter: Zuul
Branch: stable/pike

commit 70ef1fa159c9941129827dbe93d4acc718fdb7ad
Author: Dan Smith <email address hidden>
Date: Wed Nov 1 08:49:07 2017 -0700

    Avoid deleting allocations for instances being built

    The resource tracker's _remove_deleted_instances_allocations() assumes that
    InstanceNotFound means that an instance was deleted. That's not quite accurate,
    as we would also see that in the window between creating allocations and actually
    creating the instance in the cell database. So, the code now will kill
    allocations for those instances before they are created.

    This change makes us look up the instance with read_deleted=yes, and if we find
    it with deleted=True, then we do the allocation removal. This does mean that
    someone running a full DB archive at the instant an instance is deleted in some
    way that didn't result in allocation removal as well could leak those. However,
    we can log that (unlikely) situation.

    Closes-Bug: #1729371

    Conflicts:
          nova/compute/resource_tracker.py
          nova/tests/unit/compute/test_resource_tracker.py

    NOTE(mriedem): Conflicts were due to not having change
    1ff1310683c647517aa825059e4e6ad706e3da19 or change
    e3b7f43e3ae9689967d2ecd1cd7974d829c78c85 in Pike.

    Change-Id: I4482ac2ecf8e07c197fd24c520b7f11fd5a10945
    (cherry picked from commit d176175db456e4a312eed37ed4f5adcc06292fd5)