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.
Reviewed: https:/ /review. openstack. org/517009 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=d176175db45 6e4a312eed37ed4 f5adcc06292fd5
Committed: https:/
Submitter: Zuul
Branch: master
commit d176175db456e4a 312eed37ed4f5ad cc06292fd5
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 Found means that an instance was deleted. That's not quite accurate,
InstanceNot
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: I4482ac2ecf8e07 c197fd24c520b7f 11fd5a10945