]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: MDLog::_recovery_thread: handle the errors gracefully 52513/head
authorJos Collin <jcollin@redhat.com>
Fri, 23 Jun 2023 06:16:26 +0000 (11:46 +0530)
committerJos Collin <jcollin@redhat.com>
Wed, 26 Jul 2023 09:59:13 +0000 (15:29 +0530)
A write fails if the MDS is already blocklisted due to the 'fs fail' issued by the qa tests.
Handle those write failures gracefully, even when the MDS is stopping.

Fixes: https://tracker.ceph.com/issues/61201
Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit d562905dcfb5b8a45ce7042c543720ef8b0fa05b)

src/mds/MDLog.cc

index 05f815c8ef48a3e25a1a5448d0bb907919f6fbb6..2e133f650d31f26d2ec449ea5aecf10e1bb5fbc5 100644 (file)
@@ -975,8 +975,14 @@ void MDLog::_recovery_thread(MDSContext *completion)
     inodeno_t const default_log_ino = MDS_INO_LOG_OFFSET + mds->get_nodeid();
     jp.front = default_log_ino;
     int write_result = jp.save(mds->objecter);
-    // Nothing graceful we can do for this
-    ceph_assert(write_result >= 0);
+    if (write_result < 0) {
+      std::lock_guard l(mds->mds_lock);
+      if (mds->is_daemon_stopping()) {
+        return;
+      }
+      mds->damaged();
+      ceph_abort();  // damaged should never return
+    }
   } else if (read_result == -CEPHFS_EBLOCKLISTED) {
     derr << "Blocklisted during JournalPointer read!  Respawning..." << dendl;
     mds->respawn();