From 278293b3389a2a48da4fbb27a5dfd8a7c6a63ae1 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 2 Apr 2025 23:56:28 +0530 Subject: [PATCH] mgr/vol: log in case path goes in missing in async_cloner.py 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 --- src/pybind/mgr/volumes/fs/async_cloner.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/pybind/mgr/volumes/fs/async_cloner.py b/src/pybind/mgr/volumes/fs/async_cloner.py index 0d02eac9ef07c..222bb577d673b 100644 --- a/src/pybind/mgr/volumes/fs/async_cloner.py +++ b/src/pybind/mgr/volumes/fs/async_cloner.py @@ -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]) -- 2.39.5