From 2cc2fba2f069f9fa582fbed4a170b4ee844251c6 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Mon, 1 May 2017 16:53:57 +0000 Subject: [PATCH] Remove non-scheduler volume extend support In Ocata we switch volume extend operations to go through the scheduler. To support rolling upgrades, we had a fallback to calling the volume backend directly if we saw the scheduler did not support this. We can now remove this backward compatibility in Pike. Change-Id: I7a066e1d60c3cabe28347e58a136058db5b38e7d --- cinder/tests/unit/volume/test_volume.py | 13 ------------- cinder/volume/api.py | 16 ++-------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/cinder/tests/unit/volume/test_volume.py b/cinder/tests/unit/volume/test_volume.py index 001761c5eca..6ef6a7b2dd4 100644 --- a/cinder/tests/unit/volume/test_volume.py +++ b/cinder/tests/unit/volume/test_volume.py @@ -2119,19 +2119,6 @@ class VolumeTestCase(base.BaseVolumeTestCase): volume_api.scheduler_rpcapi.extend_volume.assert_called_once_with( self.context, volume, 3, ["RESERVATION"], request_spec) - # Test direct volume path - limit_check.side_effect = None - reserve.side_effect = None - db.volume_update(self.context, volume.id, {'status': 'available'}) - ext_mock = mock.MagicMock(side_effect=exception.ServiceTooOld) - volume_api.volume_rpcapi.extend_volume = mock.MagicMock() - volume_api.scheduler_rpcapi.extend_volume = ext_mock - - volume_api.extend(self.context, volume, 3) - - volume_api.volume_rpcapi.extend_volume.assert_called_once_with( - self.context, volume, 3, ["RESERVATION"]) - # clean up self.volume.delete_volume(self.context, volume) diff --git a/cinder/volume/api.py b/cinder/volume/api.py index e7209667e0b..302bf06b5ea 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -1349,20 +1349,8 @@ class API(base.Base): 'volume_id': volume.id } - try: - self.scheduler_rpcapi.extend_volume(context, volume, new_size, - reservations, request_spec) - except exception.ServiceTooOld as e: - # NOTE(erlon): During rolling upgrades scheduler and volume can - # have different versions. This check makes sure that a new - # version of the volume service won't break. - msg = ("Failed to send extend volume request to scheduler. " - "Falling back to old behaviour. This is normal during a " - "live-upgrade. Error: %(e)s") - LOG.warning(msg, {'e': e}) - # TODO(erlon): Remove in Pike - self.volume_rpcapi.extend_volume(context, volume, new_size, - reservations) + self.scheduler_rpcapi.extend_volume(context, volume, new_size, + reservations, request_spec) LOG.info("Extend volume request issued successfully.", resource=volume)