nova/nova/api/openstack/placement/objects
Jay Pipes 9ea340eb0d 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.

Related-Bug: #1786055
Partial-Bug: #1786519
Change-Id: I1fdbcdb7a1dd51e738924c8a30238237d7ac74e1
2018-08-10 16:19:42 -04:00
..
__init__.py Move resource provider objects into placement hierarchy 2018-03-13 09:01:31 +00:00
consumer.py Fix create_all() to replace_all() in comments 2018-07-27 07:43:01 +00:00
project.py Isolate placement database config 2018-06-19 13:22:04 +01:00
resource_provider.py placement: use simple code paths when possible 2018-08-10 16:19:42 -04:00
user.py Isolate placement database config 2018-06-19 13:22:04 +01:00