return seastar::now();
}
return tp->submit([this] {
- for (auto [cid, ch]: coll_map) {
- static_cast<AlienCollection*>(ch.get())->collection.reset();
+ {
+ std::lock_guard l(coll_map_lock);
+ for (auto [cid, ch]: coll_map) {
+ static_cast<AlienCollection*>(ch.get())->collection.reset();
+ }
+ coll_map.clear();
}
- coll_map.clear();
store.reset();
cct.reset();
g_ceph_context = nullptr;
}
CollectionRef AlienStore::get_alien_coll_ref(ObjectStore::CollectionHandle c) {
+ std::lock_guard l(coll_map_lock);
CollectionRef ch;
auto cp = coll_map.find(c->cid);
if (cp == coll_map.end()) {
* 2. OSD shutdown needs to *guarantee* that all outstanding CollectionRefs
* are released before unmounting and stopping the store.
*
- * coll_map is accessed exclusively from alien threadpool threads.
+ * coll_map is accessed exclusively from alien threadpool threads under the
+ * coll_map_lock.
*/
+ std::mutex coll_map_lock;
std::unordered_map<coll_t, CollectionRef> coll_map;
CollectionRef get_alien_coll_ref(ObjectStore::CollectionHandle c);
};