]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: flush monc log before abort 53484/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:49:48 +0000 (15:49 -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 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 2bb5b7d7bb8a4b251405176a46be6c6662e7dc5f..13f8e015f3dacdd73f626fa0613fda05e5db27fb 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 c52c837083b98fc9b43cfde2589d6a41a03a19ed..ca61a10b4b12d8dfda9448c59d5f0c8aff75dba4 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