[Pure Storage] Fix snapshot replication interval issue

In cinder.conf snapshot replication interval can be set in seconds.
However, backend code expects interval in milliseconds.
Added fix to handle the conversion to set replication interval properly.

Closes-Bug: #2115284
Change-Id: Ic8a63bd38b9868898167ab066e11147461ffd684
This commit is contained in:
Keerthivasan S
2025-06-24 14:58:50 -04:00
parent 111e43b9c0
commit a14e595231
3 changed files with 17 additions and 4 deletions

View File

@@ -1471,6 +1471,8 @@ class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):
"san_ip": "1.2.3.4",
"api_token": "abc123"}]
mock_getarray().get_arrays.return_value = VALID_GET_ARRAY_PRIMARY
self.mock_config.pure_replica_interval_default = (
REPLICATION_INTERVAL_IN_SEC)
self.driver.parse_replication_configs()
self.assertEqual(1, len(self.driver._replication_target_arrays))
self.assertEqual(mock_getarray(),
@@ -1503,6 +1505,8 @@ class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):
"san_ip": "1.2.3.5",
"api_token": "abc124"}]
mock_getarray.side_effect = [self.array, self.async_array2]
self.mock_config.pure_replica_interval_default = (
REPLICATION_INTERVAL_IN_SEC)
self.driver.parse_replication_configs()
self.assertEqual(2, len(self.driver._replication_target_arrays))
self.assertEqual(self.array, self.driver._replication_target_arrays[0])
@@ -1526,7 +1530,8 @@ class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):
retention = mock.MagicMock()
mock_generate_replication_retention.return_value = retention
mock_setup_repl_pgroups.return_value = None
self.mock_config.pure_replica_interval_default = (
REPLICATION_INTERVAL_IN_SEC)
# Test single array configured
self.mock_config.safe_get.return_value = [
{
@@ -1561,7 +1566,8 @@ class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):
retention = mock.MagicMock()
mock_generate_replication_retention.return_value = retention
mock_setup_repl_pgroups.return_value = None
self.mock_config.pure_replica_interval_default = (
REPLICATION_INTERVAL_IN_SEC)
# Test single array configured
self.mock_config.safe_get.return_value = [
{
@@ -1617,7 +1623,7 @@ class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):
mock.call(self.array,
[self.async_array2, self.driver._get_flasharray()],
'cinder-group',
3600, retention)
REPLICATION_INTERVAL_IN_SEC * 1000, retention)
]
mock_setup_repl_pgroups.assert_has_calls(calls)

View File

@@ -283,7 +283,7 @@ class PureBaseVolumeDriver(san.SanDriver):
self._replication_pod_name = (
self.configuration.pure_replication_pod_name)
self._replication_interval = (
self.configuration.pure_replica_interval_default)
self.configuration.pure_replica_interval_default * 1000)
self._replication_retention_short_term = (
self.configuration.pure_replica_retention_short_term_default)
self._replication_retention_long_term = (

View File

@@ -0,0 +1,7 @@
---
fixes:
- |
Pure Storage driver `bug #2115284
<https://bugs.launchpad.net/cinder/+bug/2115284>`_: snapshot replication
interval in `cinder.conf` is set in seconds, but the backend expects
it in milliseconds. Added fix to handle the conversion.