]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: improve debug logging on primary mirror snapshot creation
authorJason Dillaman <dillaman@redhat.com>
Thu, 27 Feb 2020 04:30:08 +0000 (23:30 -0500)
committerJason Dillaman <dillaman@redhat.com>
Mon, 2 Mar 2020 15:53:43 +0000 (10:53 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/mirror/snapshot/CreatePrimaryRequest.cc

index ae31256419d86539560f060292c728142a3324c5..5e9c9637dc27e3efd29f25c176f6699545584960 100644 (file)
@@ -107,14 +107,15 @@ void CreatePrimaryRequest<I>::handle_get_mirror_peers(int r) {
 
 template <typename I>
 void CreatePrimaryRequest<I>::create_snapshot() {
-  CephContext *cct = m_image_ctx->cct;
-  ldout(cct, 20) << dendl;
-
   cls::rbd::MirrorSnapshotNamespace ns{
     ((m_flags & CREATE_PRIMARY_FLAG_DEMOTED) != 0 ?
       cls::rbd::MIRROR_SNAPSHOT_STATE_PRIMARY_DEMOTED :
       cls::rbd::MIRROR_SNAPSHOT_STATE_PRIMARY),
     m_mirror_peer_uuids, "", CEPH_NOSNAP};
+
+  CephContext *cct = m_image_ctx->cct;
+  ldout(cct, 20) << "name=" << m_snap_name << ", "
+                 << "ns=" << ns << dendl;
   auto ctx = create_context_callback<
     CreatePrimaryRequest<I>,
     &CreatePrimaryRequest<I>::handle_create_snapshot>(this);
@@ -137,6 +138,7 @@ void CreatePrimaryRequest<I>::handle_create_snapshot(int r) {
     std::shared_lock image_locker{m_image_ctx->image_lock};
     *m_snap_id = m_image_ctx->get_snap_id(
       cls::rbd::MirrorSnapshotNamespace{}, m_snap_name);
+    ldout(cct, 20) << "snap_id=" << *m_snap_id << dendl;
   }
 
   unlink_peer();