]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/vol: log in case path goes in missing in async_cloner.py 62638/head
authorRishabh Dave <ridave@redhat.com>
Wed, 2 Apr 2025 18:26:28 +0000 (23:56 +0530)
committerRishabh Dave <ridave@redhat.com>
Sun, 4 May 2025 13:31:46 +0000 (19:01 +0530)
Add a log entry in case the source and/or destination path goes missing
for a clone operation.

Fixes: https://tracker.ceph.com/issues/71019
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/pybind/mgr/volumes/fs/async_cloner.py

index 0d02eac9ef07c456a74f11fa65c5721e6ccd9ab5..222bb577d673b5f32edfb2bc8b17c3838b73ce84 100644 (file)
@@ -177,12 +177,20 @@ def set_quota_on_clone(fs_handle, clone_volumes_pair):
         quota = int(fs_handle.getxattr(src_path, 'ceph.quota.max_bytes').decode('utf-8'))
     except cephfs.NoData:
         pass
+    except cephfs.ObjectNotFound:
+        log.info('set_quota_on_clone(): getxattr failed because source path '
+                 f'"{src_path}" has gone missing')
+        raise
 
     if quota is not None:
         try:
             fs_handle.setxattr(dst_path, 'ceph.quota.max_bytes', str(quota).encode('utf-8'), 0)
         except cephfs.InvalidValue:
             raise VolumeException(-errno.EINVAL, "invalid size specified: '{0}'".format(quota))
+        except cephfs.ObjectNotFound:
+            log.info('set_quota_on_clone(): getxattr failed because destination path '
+                     f'"{dst_path}" has gone missing')
+            raise
         except cephfs.Error as e:
              raise VolumeException(-e.args[0], e.args[1])
 
@@ -191,12 +199,20 @@ def set_quota_on_clone(fs_handle, clone_volumes_pair):
         quota_files = int(fs_handle.getxattr(src_path, 'ceph.quota.max_files').decode('utf-8'))
     except cephfs.NoData:
         pass
+    except cephfs.ObjectNotFound:
+        log.info('set_quota_on_clone(): getxattr failed because source path '
+                 f'"{src_path}" has gone missing')
+        raise
 
     if quota_files is not None:
         try:
             fs_handle.setxattr(dst_path, 'ceph.quota.max_files', str(quota_files).encode('utf-8'), 0)
         except cephfs.InvalidValue:
             raise VolumeException(-errno.EINVAL, "invalid file count specified: '{0}'".format(quota_files))
+        except cephfs.ObjectNotFound:
+            log.info('set_quota_on_clone(): getxattr failed because destination path '
+                     f'"{dst_path}" has gone missing')
+            raise
         except cephfs.Error as e:
              raise VolumeException(-e.args[0], e.args[1])