]> 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>
Thu, 3 Feb 2022 10:09:04 +0000 (15:39 +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 6bdb5fd72be84798864a7df93e3492647ca23c3a..d1854712b16ec327c95c1aef92f8d48257d8e8a0 100644 (file)
@@ -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)