]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not trim segments after open file table commit
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 27 Aug 2024 21:07:06 +0000 (17:07 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 25 Sep 2024 19:42:26 +0000 (15:42 -0400)
Previously, the trimming of expired segments would only occur if the open file
table's committed sequence number is past the segment to be trimmed. This is
now part of the expiry checks so it's no longer necessary to restart trimming
when the open file table commit completes.

Furthermore, this was confusing to `flush journal` as it was waiting for the
journal head write but the open file table commit already triggered the trim.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDLog.cc

index 0f33bacbd3e2b5d2d95d053a186523342d1cf2cd..99f86231847ffd96aa97ea5aec6d3d9ddd625399 100644 (file)
@@ -585,17 +585,6 @@ void MDLog::shutdown()
   }
 }
 
-class C_OFT_Committed : public MDSInternalContext {
-  MDLog *mdlog;
-  uint64_t seq;
-public:
-  C_OFT_Committed(MDLog *l, uint64_t s) :
-    MDSInternalContext(l->mds), mdlog(l), seq(s) {}
-  void finish(int ret) override {
-    mdlog->trim_expired_segments();
-  }
-};
-
 void MDLog::try_to_commit_open_file_table(uint64_t last_seq)
 {
   ceph_assert(ceph_mutex_is_locked_by_me(submit_mutex));
@@ -610,8 +599,7 @@ void MDLog::try_to_commit_open_file_table(uint64_t last_seq)
   if (mds->mdcache->open_file_table.is_any_dirty() ||
       last_seq > mds->mdcache->open_file_table.get_committed_log_seq()) {
     submit_mutex.unlock();
-    mds->mdcache->open_file_table.commit(new C_OFT_Committed(this, last_seq),
-                                         last_seq, CEPH_MSG_PRIO_HIGH);
+    mds->mdcache->open_file_table.commit(nullptr, last_seq, CEPH_MSG_PRIO_HIGH);
     submit_mutex.lock();
   }
 }