From: Xuehan Xu Date: Fri, 13 Aug 2021 13:57:27 +0000 (+0800) Subject: crimson/os/seastore: set journal_tail_target during replay X-Git-Tag: v17.1.0~919^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d9f8c01c03a302a2a5873738c9c0a2805eb7d4f7;p=ceph.git crimson/os/seastore: set journal_tail_target during replay This is a bug fix, otherwise if crimson-osd boot up multiple times without filling up more than one segment, segments may be used up and can't be reclaimed as they would have the same journal tail Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index 56ce3533bc60c..8cc0e0b44a470 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -70,7 +70,10 @@ TransactionManager::mount_ertr::future<> TransactionManager::mount() return journal->replay( std::move(segments), [this](auto seq, auto paddr, const auto &e) { - return cache->replay_delta(seq, paddr, e); + auto fut = cache->replay_delta(seq, paddr, e); + segment_cleaner->update_journal_tail_target( + cache->get_oldest_dirty_from().value_or(seq)); + return fut; }); }).safe_then([this] { return journal->open_for_write();