From: Xiubo Li Date: Tue, 24 May 2022 13:10:54 +0000 (+0800) Subject: mds/MDLog: rename capped to mds_is_shutting_down X-Git-Tag: v16.2.11~334^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2ccf8e255e65b36947f7b4a0ae8e84cc0de4e259;p=ceph.git mds/MDLog: rename capped to mds_is_shutting_down To make it more readable. Signed-off-by: Xiubo Li (cherry picked from commit ed676a3b3d77a0e33af257b357dca81efddef543) --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index a76ab4bdec41..7d8c634a4996 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -7884,7 +7884,7 @@ bool MDCache::shutdown_pass() // (only do this once!) if (!mds->mdlog->is_capped()) { - dout(7) << "capping the log" << dendl; + dout(7) << "capping the mdlog" << dendl; mds->mdlog->cap(); } diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 408909d4a3fd..79143021e494 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -279,7 +279,7 @@ void MDLog::_submit_entry(LogEvent *le, MDSLogContextBase *c) { ceph_assert(ceph_mutex_is_locked_by_me(submit_mutex)); ceph_assert(!mds->is_any_replay()); - ceph_assert(!capped); + ceph_assert(!mds_is_shutting_down); ceph_assert(le == cur_event); cur_event = NULL; @@ -480,9 +480,9 @@ void MDLog::kick_submitter() } void MDLog::cap() -{ - dout(5) << "cap" << dendl; - capped = true; +{ + dout(5) << "mark mds is shutting down" << dendl; + mds_is_shutting_down = true; } void MDLog::shutdown() @@ -501,7 +501,7 @@ void MDLog::shutdown() mds->mds_lock.unlock(); // Because MDS::stopping is true, it's safe to drop mds_lock: nobody else // picking it up will do anything with it. - + submit_mutex.lock(); submit_cond.notify_all(); submit_mutex.unlock(); @@ -583,7 +583,7 @@ void MDLog::try_to_commit_open_file_table(uint64_t last_seq) { ceph_assert(ceph_mutex_is_locked_by_me(submit_mutex)); - if (capped) // shutting down the MDS + if (mds_is_shutting_down) // shutting down the MDS return; if (mds->mdcache->open_file_table.is_any_committing()) @@ -832,7 +832,7 @@ void MDLog::_trim_expired_segments() break; } - if (!capped && ls->seq >= oft_committed_seq) { + if (!mds_is_shutting_down && ls->seq >= oft_committed_seq) { dout(10) << "_trim_expired_segments open file table committedseq " << oft_committed_seq << " <= " << ls->seq << "/" << ls->offset << dendl; break; @@ -881,9 +881,9 @@ void MDLog::_expired(LogSegment *ls) dout(5) << "_expired segment " << ls->seq << "/" << ls->offset << ", " << ls->num_events << " events" << dendl; - if (!capped && ls == peek_current_segment()) { + if (!mds_is_shutting_down && ls == peek_current_segment()) { dout(5) << "_expired not expiring " << ls->seq << "/" << ls->offset - << ", last one and !capped" << dendl; + << ", last one and !mds_is_shutting_down" << dendl; } else { // expired. expired_segments.insert(ls); diff --git a/src/mds/MDLog.h b/src/mds/MDLog.h index 13a56aa0dea5..55bb4c142751 100644 --- a/src/mds/MDLog.h +++ b/src/mds/MDLog.h @@ -121,7 +121,7 @@ public: Journaler *get_journaler() { return journaler; } bool empty() const { return segments.empty(); } - bool is_capped() const { return capped; } + bool is_capped() const { return mds_is_shutting_down; } void cap(); void kick_submitter(); @@ -258,7 +258,7 @@ protected: int num_events = 0; // in events int unflushed = 0; - bool capped = false; + bool mds_is_shutting_down = false; // Log position which is persistent *and* for which // submit_entry wait_for_safe callbacks have already