]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: set journal_tail_target during replay
authorXuehan Xu <xxhdx1985126@gmail.com>
Fri, 13 Aug 2021 13:57:27 +0000 (21:57 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Wed, 8 Sep 2021 03:03:01 +0000 (11:03 +0800)
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 <xxhdx1985126@gmail.com>
src/crimson/os/seastore/transaction_manager.cc

index 56ce3533bc60cea84186311b3a5666f87d60c345..8cc0e0b44a470acddaeb7dcc18c2cc05689c63bf 100644 (file)
@@ -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();