From: Kotresh HR Date: Wed, 12 Jan 2022 05:43:20 +0000 (+0530) Subject: mgr/volumes: Improve debugging, add clone failure logs X-Git-Tag: v17.1.0~16^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=283696584efa633f18f58b12ba1c2e94d14e8d3f;p=ceph.git mgr/volumes: Improve debugging, add clone failure logs Fixes: https://tracker.ceph.com/issues/53848 Signed-off-by: Kotresh HR (cherry picked from commit 29ad638773715c92a0c77f10731bd69167e4ce80) --- diff --git a/src/pybind/mgr/volumes/fs/async_cloner.py b/src/pybind/mgr/volumes/fs/async_cloner.py index 6bdb5fd72be8..d1854712b16e 100644 --- a/src/pybind/mgr/volumes/fs/async_cloner.py +++ b/src/pybind/mgr/volumes/fs/async_cloner.py @@ -192,6 +192,14 @@ def do_clone(fs_client, volspec, volname, groupname, subvolname, should_cancel): dst_path = clone_volumes[0].path bulk_copy(fs_handle, src_path, dst_path, should_cancel) +def log_clone_failure(volname, groupname, subvolname, ve): + if ve.errno == -errno.EINTR: + log.info("Clone cancelled: ({0}, {1}, {2})".format(volname, groupname, subvolname)) + elif ve.errno == -errno.EDQUOT: + log.error("Clone failed: ({0}, {1}, {2}, reason -> Disk quota exceeded)".format(volname, groupname, subvolname)) + else: + log.error("Clone failed: ({0}, {1}, {2}, reason -> {3})".format(volname, groupname, subvolname, ve)) + def handle_clone_in_progress(fs_client, volspec, volname, index, groupname, subvolname, should_cancel): try: do_clone(fs_client, volspec, volname, groupname, subvolname, should_cancel) @@ -199,6 +207,7 @@ def handle_clone_in_progress(fs_client, volspec, volname, index, groupname, subv SubvolumeStates.STATE_INPROGRESS, SubvolumeActions.ACTION_SUCCESS) except VolumeException as ve: + log_clone_failure(volname, groupname, subvolname, ve) next_state = get_next_state_on_error(ve.errno) except OpSmException as oe: raise VolumeException(oe.errno, oe.error_str)