The way the API node initializes it requires that all nodes are up and
running for version pinning to work correctly, otherwise it will set
version to None for the RPC clients and the serializers same thing
happens to the scheduler node for the volume rpc.
This is a problem, also on CI, because you cannot guarantee that the API
will start last, and so versions will be incorrect and cause problems in
some cases.
This patch pins RPC client and serializer to the latest known versions
when there are no services on the DB. This should only happen on CI,
devstack, and similar cases where we start everything for the first time
almost simultaneously.
An alternative that would work for the API would be to make the RPC
client lazily instantiated which solves the problem of load order as no
API requests come in before the other nodes are up and running.
But it would not solve the problem of the scheduler, as it fires a
request to volumes to publish_service_capabilities on start and that
would instantiate the rpc client.
Closes-Bug: #1569350
backport-potential: mitaka
Change-Id: I301c60c4c75cebb4fa6392fe7c9c11cedd1c09c8