]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDLog: rename capped to mds_is_shutting_down 47432/head
authorXiubo Li <xiubli@redhat.com>
Tue, 24 May 2022 13:10:54 +0000 (21:10 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 3 Aug 2022 08:09:16 +0000 (16:09 +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 b6df1cda0e4f7976249f5afcf1ac7c431214f3e8..387cd9b478b0e71c22f72dfb8207b390e6b74dbc 100644 (file)
@@ -7893,7 +7893,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 c2c3173fb1ebf3eb8f21fd9a191d99ab9a5bb42a..eea60b48ae527d475d22aaf8a69166d1c24e4971 100644 (file)
@@ -281,7 +281,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;
@@ -482,9 +482,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()
@@ -503,7 +503,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();
@@ -585,7 +585,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())
@@ -834,7 +834,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;
@@ -883,9 +883,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 51f0b3480c8f23e0e9bc0aa0989b1918f3381543..6111f85a97f97bea5a221ca429954cd23f5a4e46 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