Merge "Dell PowerMax: Enhanced the retry mechanism to verify the active snapshots."

This commit is contained in:
Zuul 2025-03-08 13:01:53 +00:00 committed by Gerrit Code Review
commit 79928cd6a9
3 changed files with 44 additions and 1 deletions

View File

@ -4900,3 +4900,34 @@ class PowerMaxCommonTest(test.TestCase):
self.mock_object(self.common, 'configuration', configuration)
kwargs_returned = self.common.get_attributes_from_cinder_config()
self.assertEqual(kwargs_expected, kwargs_returned)
@mock.patch.object(common.PowerMaxCommon, '_cleanup_device_snapvx')
@mock.patch.object(rest.PowerMaxRest, 'get_volume_snapshot_list',
side_effect=([{'snapshotName': 'temp-clone-snapshot'}],
[]))
@mock.patch.object(rest.PowerMaxRest, 'find_snap_vx_sessions',
side_effect=[(None, None)])
def test_cleanup_device_retry_1(self, mock_snapvx,
mock_ss_list, mock_clean):
self.common._cleanup_device_retry(
self.data.array, self.data.device_id, self.data.extra_specs)
self.assertEqual(2, mock_ss_list.call_count)
self.assertEqual(1, mock_snapvx.call_count)
self.assertEqual(2, mock_clean.call_count)
@mock.patch.object(common.PowerMaxCommon, '_cleanup_device_snapvx')
@mock.patch.object(rest.PowerMaxRest, 'get_volume_snapshot_list',
return_value=[{'snapshotName': 'temp-clone-snapshot'}])
@mock.patch.object(rest.PowerMaxRest, 'find_snap_vx_sessions',
side_effect=[(None, None)])
def test_cleanup_device_retry_2(self, mock_snapvx,
mock_ss_list, mock_clean):
self.assertRaises(
exception.VolumeBackendAPIException,
self.common._cleanup_device_retry,
self.data.array,
self.data.device_id,
self.data.extra_specs)
self.assertEqual(7, mock_ss_list.call_count)
self.assertEqual(0, mock_snapvx.call_count)
self.assertEqual(7, mock_clean.call_count)

View File

@ -2106,7 +2106,7 @@ class PowerMaxCommon(object):
array, device_id, volume_name, extra_specs)
return volume_name
@retry(retry_exc_tuple, interval=1, retries=3)
@retry(retry_exc_tuple, interval=2, retries=7)
def _cleanup_device_retry(self, array, device_id, extra_specs):
"""Cleanup snapvx on the device

View File

@ -0,0 +1,12 @@
---
fixes:
- |
Dell PowerMax Driver `bug #2092259
<https://bugs.launchpad.net/cinder/+bug/2092259>`_: Before
a volume can be deleted, the driver issues a command to clean up
active snapshots in the backend and then polls the backend
to make sure the cleanup has occurred.
This fix enhances the polling mechanism to give the backend
more time to do the cleanup, thereby increasing the probability
that the driver will be able to make a successful volume deletion
request.