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.
NOTE(mriedem): Conflicts were due to not having change
1ff1310683c647517aa825059e4e6ad706e3da19 or change
e3b7f43e3ae9689967d2ecd1cd7974d829c78c85 in Pike.
Change-Id: I4482ac2ecf8e07c197fd24c520b7f11fd5a10945
(cherry picked from commit d176175db456e4a312eed37ed4f5adcc06292fd5)
Reviewed: https:/ /review. openstack. org/517879 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=70ef1fa159c 9941129827dbe93 d4acc718fdb7ad
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit 70ef1fa159c9941 129827dbe93d4ac c718fdb7ad
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
Conflicts:
nova/ compute/ resource_ tracker. py
nova/ tests/unit/ compute/ test_resource_ tracker. py
NOTE(mriedem): Conflicts were due to not having change 647517aa825059e 4e6ad706e3da19 or change 9689967d2ecd1cd 7974d829c78c85 in Pike.
1ff1310683c
e3b7f43e3ae
Change-Id: I4482ac2ecf8e07 c197fd24c520b7f 11fd5a10945 312eed37ed4f5ad cc06292fd5)
(cherry picked from commit d176175db456e4a