]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/EPM: clear allocators when close
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 17 Mar 2022 08:14:21 +0000 (16:14 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Fri, 18 Mar 2022 06:13:46 +0000 (14:13 +0800)
SeaStore::mkfs() and mount() will both invoke
TransactionManager::add_segment_manager(). Without clearing allocators,
EPM will add the same allocator multiple times.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/extent_placement_manager.h
src/crimson/os/seastore/seastore.cc

index 0d1c4e49cfb517168762e7100b8bfe09667897fb..9272e31caedfe53f17b84930cd860db84f51177b 100644 (file)
@@ -262,6 +262,8 @@ public:
       return crimson::do_for_each(allocators_item.second, [](auto& allocator) {
         return allocator->stop();
       });
+    }).safe_then([this] {
+      allocators.clear();
     });
   }
 
index 81147963b2dc6c25f15381debfd273d09a0076fa..707bd425601682459c33cd43034db6a7c4bcd814 100644 (file)
@@ -345,6 +345,10 @@ SeaStore::mkfs_ertr::future<> SeaStore::mkfs(uuid_d new_osd_fsid)
         transaction_manager->add_segment_manager(segment_manager.get());
         return transaction_manager->mkfs();
       }).safe_then([this] {
+        for (auto& sec_sm : secondaries) {
+          transaction_manager->add_segment_manager(sec_sm.get());
+        }
+        transaction_manager->add_segment_manager(segment_manager.get());
         return transaction_manager->mount();
       }).safe_then([this] {
         return repeat_eagain([this] {