commit b9c26ad1717de62b3dc7b5211145091eb21e9b17
Author: Matt Riedemann <email address hidden>
Date: Thu Oct 19 14:36:29 2017 -0400
Don't update RT in _allocate_network
The call to _update_resource_tracker from
_allocate_network is a carryover from old
times when _allocate_network would call
_instance_update which would update the
resource tracker generically for any state
change in an instance.
_update_resource_tracker calls rt.update_usage
which grabs the COMPUTE_RESOURCE_SEMAPHORE lock
which is the same lock used during claims and when
the update_available_resource periodic task runs.
The update_usage method can be a bit heavy weight
if you're not actually changing anything the
resource tracker cares about, because it's re-calculating
stats for the capabilities scheduler filter and it's
collecting new inventory from the virt driver and
potentially updating that inventory for the compute
node in placement.
So given all _allocate_network is doing is changing
the state on the instance, and the state it's changing
to has nothing to do with what the resource tracker
cares about (like deleting or shelve offloading an instance),
we shouldn't call rt.update_usage and hold that big
lock unnecessarily since it could hold up other
operations happening at the same time, like creating
instances.
Closes-Bug: #1732316
Change-Id: Ib588c31a4d2075f8730409d50c99dfb04180a9cd
(cherry picked from commit 7b0d5f7f347cb1c040595000d9d6987369dce2ab)
Reviewed: https:/ /review. openstack. org/519943 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=b9c26ad1717 de62b3dc7b52111 45091eb21e9b17
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit b9c26ad1717de62 b3dc7b521114509 1eb21e9b17
Author: Matt Riedemann <email address hidden>
Date: Thu Oct 19 14:36:29 2017 -0400
Don't update RT in _allocate_network
The call to _update_ resource_ tracker from network is a carryover from old update which would update the
_allocate_
times when _allocate_network would call
_instance_
resource tracker generically for any state
change in an instance.
_update_ resource_ tracker calls rt.update_usage RESOURCE_ SEMAPHORE lock available_ resource periodic task runs.
which grabs the COMPUTE_
which is the same lock used during claims and when
the update_
The update_usage method can be a bit heavy weight
if you're not actually changing anything the
resource tracker cares about, because it's re-calculating
stats for the capabilities scheduler filter and it's
collecting new inventory from the virt driver and
potentially updating that inventory for the compute
node in placement.
So given all _allocate_network is doing is changing
the state on the instance, and the state it's changing
to has nothing to do with what the resource tracker
cares about (like deleting or shelve offloading an instance),
we shouldn't call rt.update_usage and hold that big
lock unnecessarily since it could hold up other
operations happening at the same time, like creating
instances.
Closes-Bug: #1732316
Change-Id: Ib588c31a4d2075 f8730409d50c99d fb04180a9cd 040595000d9d698 7369dce2ab)
(cherry picked from commit 7b0d5f7f347cb1c