From 3e3e791126e856e3029588d23c9a047edb74abd1 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Thu, 25 Mar 2021 17:43:27 -0700 Subject: [PATCH] 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 --- manila/scheduler/manager.py | 2 +- manila/scheduler/rpcapi.py | 25 +++++++++++++------------ manila/tests/scheduler/test_rpcapi.py | 3 ++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/manila/scheduler/manager.py b/manila/scheduler/manager.py index 160ba5153a..8dc31dd0e2 100644 --- a/manila/scheduler/manager.py +++ b/manila/scheduler/manager.py @@ -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): diff --git a/manila/scheduler/rpcapi.py b/manila/scheduler/rpcapi.py index 44cf76bb1b..0619e99057 100644 --- a/manila/scheduler/rpcapi.py +++ b/manila/scheduler/rpcapi.py @@ -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', diff --git a/manila/tests/scheduler/test_rpcapi.py b/manila/tests/scheduler/test_rpcapi.py index abe33fe090..7e102fdc27 100644 --- a/manila/tests/scheduler/test_rpcapi.py +++ b/manila/tests/scheduler/test_rpcapi.py @@ -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',