Add SIGHUP handlers to reset RPC version pins
Adding SIGHUP handlers (by implementing reset from oslo.service) to cinder-scheduler, cinder-backup and cinder-volume that reset cached RPC version pins. This is to avoid the need to restart all the services when upgrade of the deployment is completed. Some changes go a little deep into the stack, because to reload all the pins we need to recreate <service>.rpcapi.<service>API objects that are stored in the memory. Please note that SIGHUP signal is handled by oslo.service only when service runs in daemon mode (without tty attached). To test this commit in DevStack you need to add "&" to the end of the command that starts the service. Situation is more complicated with the API service, so we're leaving it with restart required for now. In the deployments with HA cinder-api is typically behind a load balancer, so restarting individual nodes one-by-one should be easy. DocImpact: Add information on rolling upgrades procedures to the docs. Implements: blueprint rpc-object-compatibility Change-Id: I03ed74e17dc9a4b9aa2ddcfbeb36a106a0f035f8
This commit is contained in:
@@ -69,6 +69,21 @@ class SchedulerManagerTestCase(test.TestCase):
|
||||
sleep_mock.assert_called_once_with(CONF.periodic_interval)
|
||||
self.assertFalse(self.manager._startup_delay)
|
||||
|
||||
@mock.patch('cinder.rpc.LAST_RPC_VERSIONS', {'cinder-volume': '1.3'})
|
||||
@mock.patch('cinder.rpc.LAST_OBJ_VERSIONS', {'cinder-volume': '1.5'})
|
||||
def test_reset(self):
|
||||
mgr = self.manager_cls()
|
||||
|
||||
volume_rpcapi = mgr.driver.volume_rpcapi
|
||||
self.assertEqual('1.3', volume_rpcapi.client.version_cap)
|
||||
self.assertEqual('1.5',
|
||||
volume_rpcapi.client.serializer._base.version_cap)
|
||||
mgr.reset()
|
||||
|
||||
volume_rpcapi = mgr.driver.volume_rpcapi
|
||||
self.assertIsNone(volume_rpcapi.client.version_cap)
|
||||
self.assertIsNone(volume_rpcapi.client.serializer._base.version_cap)
|
||||
|
||||
@mock.patch('cinder.scheduler.driver.Scheduler.'
|
||||
'update_service_capabilities')
|
||||
def test_update_service_capabilities_empty_dict(self, _mock_update_cap):
|
||||
|
||||
Reference in New Issue
Block a user