Comment 3 for bug 1569299

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/304685
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=7efb2c6267417d27938d16712bf0704a2e5f25df
Submitter: Jenkins
Branch: master

commit 7efb2c6267417d27938d16712bf0704a2e5f25df
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
    backport-potential: mitaka
    Change-Id: I21f8e81d9923f44b22cc43c9c173bc560a93c631