Comment 5 for bug 1729371

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

Reviewed: https://review.openstack.org/517009
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d176175db456e4a312eed37ed4f5adcc06292fd5
Submitter: Zuul
Branch: master

commit d176175db456e4a312eed37ed4f5adcc06292fd5
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

    Change-Id: I4482ac2ecf8e07c197fd24c520b7f11fd5a10945