From 363d89fc89195ec31a346ec3895f727cb3093aa8 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Fri, 23 Jun 2023 11:46:26 +0530 Subject: [PATCH] mds: MDLog::_recovery_thread: handle the errors gracefully 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 (cherry picked from commit d562905dcfb5b8a45ce7042c543720ef8b0fa05b) --- src/mds/MDLog.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 337c1025a3cbc..b1c8b22d8c451 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -977,8 +977,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(); -- 2.39.5