From: Patrick Donnelly Date: Tue, 27 Aug 2024 21:07:06 +0000 (-0400) Subject: mds: do not trim segments after open file table commit X-Git-Tag: testing/wip-rishabh-testing-20240930.143059~19^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=98b7402b2723544d4421f65bd2c38bfb6aadfb54;p=ceph-ci.git mds: do not trim segments after open file table commit 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 --- diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 0f33bacbd3e..99f86231847 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -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(); } }