Bump RPC version for the scheduler rpc call

https://review.opendev.org/768137 fixed
bug #1908963 by adding a timestamp field to
the "update_service_capabilities" rpc API
call to the scheduler service.

It's possible that during an upgrade, the
share service is upgraded before a given
scheduler service, and an updated client
could start sending messages with this
extra data that wasn't expected. Lets
bump the version so that the client
messages are just waiting for an updated
scheduler to show up and consume the
messages rather than raise syntax
errors.

Partial-Bug: #1908963
Change-Id: I0d9fc311ffd296bd6153b7190f8f5c42f494a39d
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
This commit is contained in:
Goutham Pacha Ravi 2021-03-25 17:43:27 -07:00
parent a411f521d4
commit 3e3e791126
3 changed files with 16 additions and 14 deletions

View File

@ -65,7 +65,7 @@ MAPPING = {
class SchedulerManager(manager.Manager):
"""Chooses a host to create shares."""
RPC_API_VERSION = '1.9'
RPC_API_VERSION = '1.10'
def __init__(self, scheduler_driver=None, service_name=None,
*args, **kwargs):

View File

@ -31,20 +31,21 @@ class SchedulerAPI(object):
API version history:
1.0 - Initial version.
1.1 - Add get_pools method
1.2 - Introduce Share Instances. Replace ``create_share()`` with
1.0 - Initial version.
1.1 - Add get_pools method
1.2 - Introduce Share Instances. Replace ``create_share()`` with
``create_share_instance()``
1.3 - Add create_consistency_group method (renamed in 1.7)
1.4 - Add migrate_share_to_host method
1.5 - Add create_share_replica
1.6 - Add manage_share
1.7 - Updated migrate_share_to_host method with new parameters
1.8 - Rename create_consistency_group -> create_share_group method
1.9 - Add cached parameter to get_pools method
1.3 - Add create_consistency_group method (renamed in 1.7)
1.4 - Add migrate_share_to_host method
1.5 - Add create_share_replica
1.6 - Add manage_share
1.7 - Updated migrate_share_to_host method with new parameters
1.8 - Rename create_consistency_group -> create_share_group method
1.9 - Add cached parameter to get_pools method
1.10 - Add timestamp to update_service_capabilities
"""
RPC_API_VERSION = '1.9'
RPC_API_VERSION = '1.10'
def __init__(self):
super(SchedulerAPI, self).__init__()
@ -64,7 +65,7 @@ class SchedulerAPI(object):
def update_service_capabilities(self, context,
service_name, host,
capabilities):
call_context = self.client.prepare(fanout=True, version='1.0')
call_context = self.client.prepare(fanout=True, version='1.10')
timestamp = jsonutils.to_primitive(timeutils.utcnow())
call_context.cast(context,
'update_service_capabilities',

View File

@ -75,7 +75,8 @@ class SchedulerRpcAPITestCase(test.TestCase):
service_name='fake_name',
host='fake_host',
capabilities='fake_capabilities',
fanout=True)
fanout=True,
version='1.10')
def test_create_share_instance(self):
self._test_scheduler_api('create_share_instance',