From e7a298bd1e085b84f6cb71e753b5f71b6e7cef3a Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Thu, 8 May 2025 20:35:39 +0530 Subject: [PATCH] mgr/vol: keep clone source info even after cloning is finished 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 (cherry picked from commit bbacfdae1a2e7eb60f91b75852bcd1096b6e3c84) (cherry picked from commit 2c9a84a8c949c7ace5d98780819f40ff2c19f544) --- src/pybind/mgr/volumes/fs/async_cloner.py | 1 - .../mgr/volumes/fs/operations/versions/subvolume_v1.py | 5 ----- 2 files changed, 6 deletions(-) diff --git a/src/pybind/mgr/volumes/fs/async_cloner.py b/src/pybind/mgr/volumes/fs/async_cloner.py index 8277372f0ad..c22c6ee4816 100644 --- a/src/pybind/mgr/volumes/fs/async_cloner.py +++ b/src/pybind/mgr/volumes/fs/async_cloner.py @@ -272,7 +272,6 @@ def handle_clone_complete(fs_client, volspec, volname, index, groupname, subvoln with open_clone_subvol_pair_in_vol(fs_client, volspec, 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) diff --git a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py index ff1b76da0a0..411d0cabbcf 100644 --- a/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py +++ b/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v1.py @@ -139,11 +139,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) -- 2.47.3