commit 9ea340eb0d3bdb103bd64ca40b999bd2b10b80aa
Author: Jay Pipes <email address hidden>
Date: Thu Aug 9 10:46:20 2018 -0400
placement: use simple code paths when possible
Somewhere in the past release, we started using extremely complex code
paths involving sharing providers, anchor providers, and nested resource
provider calculations when we absolutely don't need to do so.
There was a _has_provider_trees() function in the
nova/api/openstack/placement/objects/resource_provider.py file that used
to be used for top-level switching between a faster, simpler approach to
finding allocation candidates for a simple search of resources and
traits when no sharing providers and no nesting was used. That was
removed at some point and all code paths -- even for simple "get me
these amounts of these resources" when no trees or sharing providers are
present (which is the vast majority of OpenStack deployments) -- were
going through the complex tree-search-and-match queries and algorithms.
This patch changes that so that when there's a request for some
resources and there's no trees or sharing providers, we do the simple
code path. Hopefully this gets our performance for the simple, common
cases back to where we were pre-Rocky.
This change is a prerequisite for the following change which adds
debugging output to help diagnose which resource classes are running
out of inventory when GET /allocation_candidates returns 0 results.
That code is not possible without the changes here as they only
work if we can identify when a "simpler approach" is possible and
call that simpler code.
Reviewed: https:/ /review. openstack. org/590388 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=9ea340eb0d3 bdb103bd64ca40b 999bd2b10b80aa
Committed: https:/
Submitter: Zuul
Branch: master
commit 9ea340eb0d3bdb1 03bd64ca40b999b d2b10b80aa
Author: Jay Pipes <email address hidden>
Date: Thu Aug 9 10:46:20 2018 -0400
placement: use simple code paths when possible
Somewhere in the past release, we started using extremely complex code
paths involving sharing providers, anchor providers, and nested resource
provider calculations when we absolutely don't need to do so.
There was a _has_provider_ trees() function in the api/openstack/ placement/ objects/ resource_ provider. py file that used and-match queries and algorithms.
nova/
to be used for top-level switching between a faster, simpler approach to
finding allocation candidates for a simple search of resources and
traits when no sharing providers and no nesting was used. That was
removed at some point and all code paths -- even for simple "get me
these amounts of these resources" when no trees or sharing providers are
present (which is the vast majority of OpenStack deployments) -- were
going through the complex tree-search-
This patch changes that so that when there's a request for some
resources and there's no trees or sharing providers, we do the simple
code path. Hopefully this gets our performance for the simple, common
cases back to where we were pre-Rocky.
This change is a prerequisite for the following change which adds candidates returns 0 results.
debugging output to help diagnose which resource classes are running
out of inventory when GET /allocation_
That code is not possible without the changes here as they only
work if we can identify when a "simpler approach" is possible and
call that simpler code.
Related-Bug: #1786055 e738924c8a30238 237d7ac74e1
Partial-Bug: #1786519
Change-Id: I1fdbcdb7a1dd51