Browse Source

Unity: unexpected data in share from snapshot

The share created from snapshot had inconsistent data with the snapshot,
but consistent with the original share. Because the snapshot was
created on wrong `storage resource`.

Change-Id: Ia135c93bd9eedaba549426ea9233a90767de5d46
Closes-bug: 1701458
(cherry picked from commit ee32ed6a57)
Ryan Liang 1 year ago
parent
commit
8dbc944af5

+ 2
- 6
manila/share/drivers/dell_emc/plugins/unity/client.py View File

@@ -212,18 +212,14 @@ class UnityClient(object):
212 212
             LOG.info(_LI('Snapshot %(snap)s on Filesystem %(fs)s already '
213 213
                          'exists.'), {'snap': name, 'fs': filesystem.name})
214 214
 
215
-    def create_snap_of_snap(self, src_snap, dst_snap_name, snap_type):
216
-        access_type = enums.FilesystemSnapAccessTypeEnum.PROTOCOL
217
-        if snap_type == 'checkpoint':
218
-            access_type = enums.FilesystemSnapAccessTypeEnum.CHECKPOINT
219
-
215
+    def create_snap_of_snap(self, src_snap, dst_snap_name):
220 216
         if isinstance(src_snap, six.string_types):
221 217
             snap = self.get_snapshot(name=src_snap)
222 218
         else:
223 219
             snap = src_snap
224 220
 
225 221
         try:
226
-            return snap.create_snap(dst_snap_name, fs_access_type=access_type)
222
+            return snap.create_snap(dst_snap_name)
227 223
         except storops_ex.UnitySnapNameInUseError:
228 224
             return self.get_snapshot(dst_snap_name)
229 225
 

+ 2
- 5
manila/share/drivers/dell_emc/plugins/unity/connection.py View File

@@ -213,8 +213,7 @@ class UnityStorageConnection(driver.StorageConnection):
213 213
             raise exception.EMCUnityError(err=message)
214 214
 
215 215
         backend_snap = self.client.create_snap_of_snap(snapshot['id'],
216
-                                                       share_name,
217
-                                                       snap_type='snapshot')
216
+                                                       share_name)
218 217
 
219 218
         locations = None
220 219
         if share_proto == 'CIFS':
@@ -274,9 +273,7 @@ class UnityStorageConnection(driver.StorageConnection):
274 273
 
275 274
         snapshot_name = snapshot['id']
276 275
         if self._is_share_from_snapshot(backend_share):
277
-            self.client.create_snap_of_snap(backend_share.snap,
278
-                                            snapshot_name,
279
-                                            snap_type='checkpoint')
276
+            self.client.create_snap_of_snap(backend_share.snap, snapshot_name)
280 277
         else:
281 278
             self.client.create_snapshot(backend_share.filesystem,
282 279
                                         snapshot_name)

+ 1
- 2
manila/tests/share/drivers/dell_emc/plugins/unity/test_client.py View File

@@ -148,8 +148,7 @@ class TestClient(test.TestCase):
148 148
         snapshot = mocked_input['src_snapshot']
149 149
         dest_snap = mocked_input['dest_snapshot']
150 150
 
151
-        new_snap = client.create_snap_of_snap(
152
-            snapshot, dest_snap.name, 'checkpoint')
151
+        new_snap = client.create_snap_of_snap(snapshot, dest_snap.name)
153 152
 
154 153
         self.assertEqual(dest_snap.name, new_snap.name)
155 154
 

+ 5
- 0
releasenotes/notes/unexpected-data-of-share-from-snap-134189fc0f3eeedf.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+fixes:
3
+  - Fixed bug in Dell EMC Unity driver that caused shares created from
4
+    snapshots to contain data from the original shares, instead of data from
5
+    their snapshots.

Loading…
Cancel
Save