Skip to content

Commit 98b7402

Browse files
committed
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 <[email protected]>
1 parent b2711f6 commit 98b7402

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/mds/MDLog.cc

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -585,17 +585,6 @@ void MDLog::shutdown()
585585
}
586586
}
587587

588-
class C_OFT_Committed : public MDSInternalContext {
589-
MDLog *mdlog;
590-
uint64_t seq;
591-
public:
592-
C_OFT_Committed(MDLog *l, uint64_t s) :
593-
MDSInternalContext(l->mds), mdlog(l), seq(s) {}
594-
void finish(int ret) override {
595-
mdlog->trim_expired_segments();
596-
}
597-
};
598-
599588
void MDLog::try_to_commit_open_file_table(uint64_t last_seq)
600589
{
601590
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)
610599
if (mds->mdcache->open_file_table.is_any_dirty() ||
611600
last_seq > mds->mdcache->open_file_table.get_committed_log_seq()) {
612601
submit_mutex.unlock();
613-
mds->mdcache->open_file_table.commit(new C_OFT_Committed(this, last_seq),
614-
last_seq, CEPH_MSG_PRIO_HIGH);
602+
mds->mdcache->open_file_table.commit(nullptr, last_seq, CEPH_MSG_PRIO_HIGH);
615603
submit_mutex.lock();
616604
}
617605
}

0 commit comments

Comments
 (0)