]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: flush monc log before abort 52638/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 25 Jul 2023 19:07:21 +0000 (15:07 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 25 Jul 2023 19:07:21 +0000 (15:07 -0400)
These are asynchronously flushed periodically. If the MDS plans to abort (and
we know messages are pending), it needs to manually trigger a flush.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/CDentry.cc
src/mds/MDSRank.cc
src/mds/MDSRank.h

index 6f20f53d144da61e3a95fb81384e5655f64bbab4..eda37ccb4df783b89589261e80879bc73b2bebff 100644 (file)
@@ -716,7 +716,7 @@ bool CDentry::check_corruption(bool load)
     }
     if (!load && g_conf().get_val<bool>("mds_abort_on_newly_corrupt_dentry")) {
       dir->mdcache->mds->clog->error() << "MDS abort because newly corrupt dentry to be committed: " << *this;
-      ceph_abort("detected newly corrupt dentry"); /* avoid writing out newly corrupted dn */
+      dir->mdcache->mds->abort("detected newly corrupt dentry"); /* avoid writing out newly corrupted dn */
     }
     return true;
   }
index d0323fbadc22713a836936cf1341fa2daed8caee..a43bd3a5bc2bdbbddce31fd7a0c96097a7c5ef03 100644 (file)
@@ -934,6 +934,12 @@ void MDSRank::respawn()
   }
 }
 
+void MDSRank::abort(std::string_view msg)
+{
+  monc->flush_log();
+  ceph_abort(msg);
+}
+
 void MDSRank::damaged()
 {
   ceph_assert(whoami != MDS_RANK_NONE);
index 3e353cf962bc971a5de5b0403ca9f6a05c464cbe..084ac6d0ff7984cc0a3b522e3be3785967d7f77e 100644 (file)
@@ -295,6 +295,13 @@ class MDSRank {
       return count * _heartbeat_reset_grace;
     }
 
+    /**
+     * Abort the MDS and flush any clog messages.
+     *
+     * Callers must already hold mds_lock.
+     */
+    void abort(std::string_view msg);
+
     /**
      * Report state DAMAGED to the mon, and then pass on to respawn().  Call
      * this when an unrecoverable error is encountered while attempting