]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDLog: rename capped to mds_is_shutting_down 47433/head
authorXiubo Li <xiubli@redhat.com>
Tue, 24 May 2022 13:10:54 +0000 (21:10 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 30 Aug 2022 02:43:01 +0000 (10:43 +0800)
To make it more readable.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit ed676a3b3d77a0e33af257b357dca81efddef543)

src/mds/MDCache.cc
src/mds/MDLog.cc
src/mds/MDLog.h

index a76ab4bdec41616df294eea395fa01cac3af199e..7d8c634a49963c98e300e10a5b10a8a7c2cd083f 100644 (file)
@@ -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();
   }
   
index 408909d4a3fd260586a577a8677ed5e93ebbf94b..79143021e494715ae36ae2cb96720924b5d9dd3c 100644 (file)
@@ -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);
index 13a56aa0dea5312089203c74d4caf797b64a7c95..55bb4c142751b6213dc90f51a140b835cfb6d0fa 100644 (file)
@@ -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