When a service starts (c-sch, c-bak, c-vol) they set the versions for
the RPC client and serializer using existing Service entries in the DB,
but they don't consider themselves when determining the minimum version.
By not considering themselves we have 2 problematic scenarios:
1- When a service is first started it will pin to None version since
there are no Services in the DB 2- When a service is upgraded and
restarted it will pin to the old version since the entry in the DB has
not been updated yet.
The problem is that Service.__init__ creates the service manager, which
in turn creates required RPC API instances, and it is at this point that
the pinning happens without the presence of this service DB entry.
This patch fixes this by moving the creation of the DB entry from the
Service.start method to the Service.__init__ method that gets called
from Service.create method.
There was an alternative solution, but it was more intrusive since it
required changes not only to Service.start but also to all managers
(since each one create different instances RPC APIs.
Reviewed: https:/ /review. openstack. org/304685 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=7efb2c62674 17d27938d16712b f0704a2e5f25df
Committed: https:/
Submitter: Jenkins
Branch: master
commit 7efb2c6267417d2 7938d16712bf070 4a2e5f25df
Author: Gorka Eguileor <email address hidden>
Date: Tue Apr 12 13:50:55 2016 +0200
Fix service version pinning on start
When a service starts (c-sch, c-bak, c-vol) they set the versions for
the RPC client and serializer using existing Service entries in the DB,
but they don't consider themselves when determining the minimum version.
By not considering themselves we have 2 problematic scenarios:
1- When a service is first started it will pin to None version since
there are no Services in the DB 2- When a service is upgraded and
restarted it will pin to the old version since the entry in the DB has
not been updated yet.
The problem is that Service.__init__ creates the service manager, which
in turn creates required RPC API instances, and it is at this point that
the pinning happens without the presence of this service DB entry.
This patch fixes this by moving the creation of the DB entry from the
Service.start method to the Service.__init__ method that gets called
from Service.create method.
There was an alternative solution, but it was more intrusive since it
required changes not only to Service.start but also to all managers
(since each one create different instances RPC APIs.
Closes-Bug: #1569299 potential: mitaka 4b22cc43c9c173b c560a93c631
backport-
Change-Id: I21f8e81d9923f4