mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
Merge pull request #41708 from tchaikov/wip-seastore-open-coll
crimson/os/seastore: open_collection() returns nullptr if DNE Reviewed-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
commit
76d882bd6d
@ -48,13 +48,9 @@ CollectionNode::list()
|
||||
{
|
||||
read_to_local();
|
||||
logger().debug("CollectionNode:{}, {}", __func__, *this);
|
||||
std::vector<std::pair<coll_t, coll_info_t>> list_result;
|
||||
for (auto &&it : decoded) {
|
||||
list_result.emplace_back(
|
||||
std::make_pair(
|
||||
static_cast<coll_t>(it.first),
|
||||
coll_info_t{ it.second }
|
||||
));
|
||||
CollectionManager::list_ret_bare list_result;
|
||||
for (auto &[coll, bits] : decoded) {
|
||||
list_result.emplace_back(coll, bits);
|
||||
}
|
||||
return list_ret(
|
||||
list_ertr::ready_future_marker{},
|
||||
|
@ -155,7 +155,14 @@ seastar::future<CollectionRef> SeaStore::open_collection(const coll_t& cid)
|
||||
{
|
||||
LOG_PREFIX(SeaStore::open_collection);
|
||||
DEBUG("{}", cid);
|
||||
return seastar::make_ready_future<CollectionRef>(_get_collection(cid));
|
||||
return list_collections().then([cid, this] (auto colls) {
|
||||
if (auto found = std::find(colls.begin(), colls.end(), cid);
|
||||
found != colls.end()) {
|
||||
return seastar::make_ready_future<CollectionRef>(_get_collection(cid));
|
||||
} else {
|
||||
return seastar::make_ready_future<CollectionRef>();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
seastar::future<std::vector<coll_t>> SeaStore::list_collections()
|
||||
|
Loading…
Reference in New Issue
Block a user