Make nova.compute.rpcapi.ComputeAPI.router a singleton
When starting nova-api before any nova-computes are started
and registered in the cell DBs, and with
[upgrade_levels]/compute=auto, the compute RPC API client
construction will iterate all cells looking for a minimum
nova-compute service version, not find one, and thus not
cache the result in the LAST_VERSION global.
There are 30+ API controller classes that construct an
instance of nova.compute.api.API which itself constructs
a nova.compute.rpcapi.ComputeAPI object which determines
the version cap as described above, and that is per API
worker. Each cell DB call goes through RequestContext.set_target_cell
which has a lock in it, so in this scenario on start of
nova-api there can be a lot of locking log messages for
get_or_set_cached_cell_and_set_connections.
The RPC API ClientRouter can be a singleton and just constructed
on first access to avoid the redundant database queries which
is what this change does.
To preserve the LAST_VERSION re-calculation that was in
ComputeManager.reset(), we have to also reset the _ROUTER global
so ComputeManager.reset() now resets all of the compute RPC API
globals.
Reviewed: https:/ /review. opendev. org/649197 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=ae659668b56 79cf7223474193d 3b9a584dd3f016
Committed: https:/
Submitter: Zuul
Branch: master
commit ae659668b5679cf 7223474193d3b9a 584dd3f016
Author: Matt Riedemann <email address hidden>
Date: Mon Apr 1 17:41:15 2019 -0400
Make nova.compute. rpcapi. ComputeAPI. router a singleton
When starting nova-api before any nova-computes are started levels] /compute= auto, the compute RPC API client
and registered in the cell DBs, and with
[upgrade_
construction will iterate all cells looking for a minimum
nova-compute service version, not find one, and thus not
cache the result in the LAST_VERSION global.
There are 30+ API controller classes that construct an api.API which itself constructs rpcapi. ComputeAPI object which determines set_target_ cell or_set_ cached_ cell_and_ set_connections .
instance of nova.compute.
a nova.compute.
the version cap as described above, and that is per API
worker. Each cell DB call goes through RequestContext.
which has a lock in it, so in this scenario on start of
nova-api there can be a lot of locking log messages for
get_
The RPC API ClientRouter can be a singleton and just constructed
on first access to avoid the redundant database queries which
is what this change does.
To preserve the LAST_VERSION re-calculation that was in ger.reset( ), we have to also reset the _ROUTER global reset() now resets all of the compute RPC API
ComputeMana
so ComputeManager.
globals.
Change-Id: I48109d5e32a2e9 635c240da1c77f7 f6cc7e3c76d
Related-Bug: #1807219
Related-Bug: #1815697