]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/vol: keep clone source info even after cloning is finished
authorRishabh Dave <ridave@redhat.com>
Thu, 8 May 2025 15:05:39 +0000 (20:35 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 23 Jul 2025 13:56:30 +0000 (19:26 +0530)
Instead of removing the information regarding source of a cloned
subvolume from the .meta file after the cloning has finished, keep it as
it is as the user may find it useful.

Fixes: https://tracker.ceph.com/issues/71266
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit bbacfdae1a2e7eb60f91b75852bcd1096b6e3c84)

Conflicts:
src/pybind/mgr/volumes/fs/async_cloner.py
- open_clone_subvol_pair_in_vol() is not present on Squid branch leading
  to this conflict.

src/pybind/mgr/volumes/fs/async_cloner.py
src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py

index 685b2f03c78c06a40a71b5173cd2f476b13ca152..0ff5a6786d3849f963d9fb716366f171d8af0b41 100644 (file)
@@ -282,7 +282,6 @@ def handle_clone_complete(fs_client, volspec, volname, index, groupname, subvoln
                                            volname, groupname, subvolname) \
                 as (subvol0, subvol1, subvol2):
                 subvol1.detach_snapshot(subvol2, index)
-                subvol0.remove_clone_source(flush=True)
     except (MetadataMgrException, VolumeException) as e:
         log.error("failed to detach clone from snapshot: {0}".format(e))
     return (None, True)
index ec817d7e3d2f636037afce34e0f30a2e2eabd207..20f67a58e7d70b3f9a6ef89cc5a32317b0415eae 100644 (file)
@@ -136,11 +136,6 @@ class SubvolumeV1(SubvolumeBase, SubvolumeTemplate):
         if flush:
             self.metadata_mgr.flush()
 
-    def remove_clone_source(self, flush=False):
-        self.metadata_mgr.remove_section("source")
-        if flush:
-            self.metadata_mgr.flush()
-
     def add_clone_failure(self, errno, error_msg):
         try:
             self.metadata_mgr.add_section(MetadataManager.CLONE_FAILURE_SECTION)