]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: flush monc log before abort 53485/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 25 Jul 2023 19:07:21 +0000 (15:07 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 15 Sep 2023 19:52:06 +0000 (15:52 -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>
(cherry picked from commit 59c5a50bd9e69d58b4cdb9eff68b55fb2ccb4f29)

src/mds/CDentry.cc
src/mds/MDSRank.cc
src/mds/MDSRank.h

index aac7c17eda3f693260a5c4794cbe31a6aae93f9f..1b1160850cf828457d1738f57ec14d8a7a78a742 100644 (file)
@@ -700,7 +700,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 03a78cc32211038090f1b4d102f628b6ea53dad1..5867072f951b68bcbac91ae959d0d8b62099727a 100644 (file)
@@ -931,6 +931,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 e4bb0c7c9bbc50333c5e93b0ceaf67a014277b8a..e4217642c481c10f8af3f0099747e76b545534dc 100644 (file)
@@ -294,6 +294,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