]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: Improve debugging, add clone failure logs
authorKotresh HR <khiremat@redhat.com>
Wed, 12 Jan 2022 05:43:20 +0000 (11:13 +0530)
committerKotresh HR <khiremat@redhat.com>
Mon, 28 Feb 2022 11:56:00 +0000 (17:26 +0530)
Fixes: https://tracker.ceph.com/issues/53848
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 29ad638773715c92a0c77f10731bd69167e4ce80)

src/pybind/mgr/volumes/fs/async_cloner.py

index 443232b34619c5e6c1c2a2763929abde38c79c0f..d2145eb1545884ecdc78bc3f2fd36825ccbde0ea 100644 (file)
@@ -191,6 +191,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)
@@ -198,6 +206,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)