From: Rishabh Dave Date: Wed, 2 Apr 2025 18:26:28 +0000 (+0530) Subject: mgr/vol: log in case path goes in missing in async_cloner.py X-Git-Tag: v20.1.0~29^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d636eed991d8cf808f4085a1a8972e93c275665;p=ceph.git 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 (cherry picked from commit 278293b3389a2a48da4fbb27a5dfd8a7c6a63ae1) --- diff --git a/src/pybind/mgr/volumes/fs/async_cloner.py b/src/pybind/mgr/volumes/fs/async_cloner.py index 0d02eac9ef0..222bb577d67 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])