From 82fedbd0089073cfe86640eaa7d73ed1e2545c31 Mon Sep 17 00:00:00 2001 From: chunmei Liu Date: Mon, 3 Jun 2019 20:18:20 -0700 Subject: [PATCH] crimson: add FuturizedStore to encapsulate cyanstore only add encapsulation. alien store will be implement later. exception handling will be implement later. Signed-off-by: chunmei Liu --- src/crimson/os/CMakeLists.txt | 1 + src/crimson/os/cyan_store.cc | 6 +- src/crimson/os/cyan_store.h | 69 ++++++---------- src/crimson/os/futurized_store.cc | 16 ++++ src/crimson/os/futurized_store.h | 108 ++++++++++++++++++++++++++ src/crimson/osd/ec_backend.cc | 2 +- src/crimson/osd/ec_backend.h | 4 +- src/crimson/osd/osd.cc | 7 +- src/crimson/osd/osd.h | 4 +- src/crimson/osd/osd_meta.cc | 2 +- src/crimson/osd/osd_meta.h | 6 +- src/crimson/osd/pg.cc | 4 +- src/crimson/osd/pg.h | 4 +- src/crimson/osd/pg_backend.cc | 10 +-- src/crimson/osd/pg_backend.h | 9 ++- src/crimson/osd/pg_meta.cc | 23 +++--- src/crimson/osd/pg_meta.h | 6 +- src/crimson/osd/replicated_backend.cc | 4 +- src/crimson/osd/replicated_backend.h | 2 +- src/crimson/osd/shard_services.cc | 2 +- src/crimson/osd/shard_services.h | 8 +- src/osd/PGLog.h | 16 ++-- 22 files changed, 208 insertions(+), 105 deletions(-) create mode 100644 src/crimson/os/futurized_store.cc create mode 100644 src/crimson/os/futurized_store.h diff --git a/src/crimson/os/CMakeLists.txt b/src/crimson/os/CMakeLists.txt index 6362148bd57..38b352449c0 100644 --- a/src/crimson/os/CMakeLists.txt +++ b/src/crimson/os/CMakeLists.txt @@ -2,6 +2,7 @@ add_library(crimson-os cyan_store.cc cyan_collection.cc cyan_object.cc + futurized_store.cc ${PROJECT_SOURCE_DIR}/src/os/Transaction.cc) target_link_libraries(crimson-os crimson) diff --git a/src/crimson/os/cyan_store.cc b/src/crimson/os/cyan_store.cc index 93770897b1c..79102f0f6f5 100644 --- a/src/crimson/os/cyan_store.cc +++ b/src/crimson/os/cyan_store.cc @@ -215,7 +215,7 @@ seastar::future CyanStore::get_attrs(CollectionRef c, seastar::future CyanStore::omap_get_values(CollectionRef c, const ghobject_t& oid, - std::vector&& keys) + const omap_keys_t& keys) { logger().debug("{} {} {}", __func__, c->cid, oid); @@ -344,7 +344,7 @@ seastar::future<> CyanStore::do_transaction(CollectionRef ch, { const coll_t &cid = i.get_cid(op->cid); const ghobject_t &oid = i.get_oid(op->oid); - std::set keys; + omap_keys_t keys; i.decode_keyset(keys); r = _omap_rmkeys(cid, oid, keys); } @@ -492,7 +492,7 @@ int CyanStore::_omap_set_header( int CyanStore::_omap_rmkeys( const coll_t& cid, const ghobject_t& oid, - const std::set &aset) + const omap_keys_t& aset) { logger().debug( "{} {} {} {} keys", diff --git a/src/crimson/os/cyan_store.h b/src/crimson/os/cyan_store.h index 0faed53342d..4da2373b968 100644 --- a/src/crimson/os/cyan_store.h +++ b/src/crimson/os/cyan_store.h @@ -16,13 +16,15 @@ #include "osd/osd_types.h" #include "include/uuid.h" +#include "futurized_store.h" + namespace ceph::os { class Collection; class Transaction; // a just-enough store for reading/writing the superblock -class CyanStore { +class CyanStore final : public FuturizedStore { constexpr static unsigned MAX_KEYS_PER_OMAP_GET_CALL = 32; const std::string path; @@ -32,81 +34,54 @@ class CyanStore { uuid_d osd_fsid; public: - template - class Exception : public std::logic_error { - public: - using std::logic_error::logic_error; - - // Throwing an exception isn't the sole way to signalize an error - // with it. This approach nicely fits cold, infrequent issues but - // when applied to a hot one (like ENOENT on write path), it will - // likely hurt performance. - // Alternative approach for hot errors is to create exception_ptr - // on our own and place it in the future via make_exception_future. - // When ::handle_exception is called, handler would inspect stored - // exception whether it's hot-or-cold before rethrowing it. - // The main advantage is both types flow through very similar path - // based on future::handle_exception. - static bool is_class_of(const std::exception_ptr& ep) { - // Seastar offers hacks for making throwing lock-less but stack - // unwinding still can be a problem so painful to justify going - // with non-standard, obscure things like this one. - return *ep.__cxa_exception_type() == typeid(ConcreteExceptionT); - } - }; - - struct EnoentException : public Exception { - using Exception::Exception; - }; CyanStore(const std::string& path); - ~CyanStore(); + ~CyanStore() final; - seastar::future<> mount(); - seastar::future<> umount(); + seastar::future<> mount() final; + seastar::future<> umount() final; - seastar::future<> mkfs(); + seastar::future<> mkfs() final; seastar::future read(CollectionRef c, const ghobject_t& oid, uint64_t offset, size_t len, - uint32_t op_flags = 0); + uint32_t op_flags = 0) final; seastar::future get_attr(CollectionRef c, const ghobject_t& oid, - std::string_view name); - using attrs_t = std::map>; - seastar::future get_attrs(CollectionRef c, const ghobject_t& oid); + std::string_view name) final; + seastar::future get_attrs(CollectionRef c, + const ghobject_t& oid) final; - using omap_values_t = std::map>; seastar::future omap_get_values( CollectionRef c, const ghobject_t& oid, - std::vector&& keys); + const omap_keys_t& keys) final; seastar::future, ghobject_t> list_objects( CollectionRef c, const ghobject_t& start, const ghobject_t& end, - uint64_t limit); + uint64_t limit) final; /// Retrieves paged set of values > start (if present) seastar::future omap_get_values( CollectionRef c, ///< [in] collection const ghobject_t &oid, ///< [in] oid const std::optional &start ///< [in] start, empty for begin - ); ///< @return values.empty() iff done + ) final; ///< @return values.empty() iff done - CollectionRef create_new_collection(const coll_t& cid); - CollectionRef open_collection(const coll_t& cid); - std::vector list_collections(); + CollectionRef create_new_collection(const coll_t& cid) final; + CollectionRef open_collection(const coll_t& cid) final; + std::vector list_collections() final; seastar::future<> do_transaction(CollectionRef ch, - Transaction&& txn); + Transaction&& txn) final; void write_meta(const std::string& key, - const std::string& value); - int read_meta(const std::string& key, std::string* value); - uuid_d get_fsid() const; + const std::string& value) final; + int read_meta(const std::string& key, std::string* value) final; + uuid_d get_fsid() const final; private: int _remove(const coll_t& cid, const ghobject_t& oid); @@ -125,7 +100,7 @@ private: int _omap_rmkeys( const coll_t& cid, const ghobject_t& oid, - const std::set &aset); + const omap_keys_t& aset); int _omap_rmkeyrange( const coll_t& cid, const ghobject_t& oid, diff --git a/src/crimson/os/futurized_store.cc b/src/crimson/os/futurized_store.cc new file mode 100644 index 00000000000..e6883b39811 --- /dev/null +++ b/src/crimson/os/futurized_store.cc @@ -0,0 +1,16 @@ +#include "futurized_store.h" +#include "cyan_store.h" + +namespace ceph::os { + +std::unique_ptr FuturizedStore::create(const std::string& type, + const std::string& data) +{ + if (type == "memstore") { + return std::make_unique(data); + } + + return nullptr; +} + +} diff --git a/src/crimson/os/futurized_store.h b/src/crimson/os/futurized_store.h new file mode 100644 index 00000000000..49ad867c123 --- /dev/null +++ b/src/crimson/os/futurized_store.h @@ -0,0 +1,108 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#pragma once + +#include +#include +#include +#include +#include + +#include + +#include "include/buffer_fwd.h" +#include "include/uuid.h" +#include "osd/osd_types.h" + +namespace ceph::os { + +class Collection; +class Transaction; + +class FuturizedStore { + +public: + template + class Exception : public std::logic_error { + public: + using std::logic_error::logic_error; + + // Throwing an exception isn't the sole way to signalize an error + // with it. This approach nicely fits cold, infrequent issues but + // when applied to a hot one (like ENOENT on write path), it will + // likely hurt performance. + // Alternative approach for hot errors is to create exception_ptr + // on our own and place it in the future via make_exception_future. + // When ::handle_exception is called, handler would inspect stored + // exception whether it's hot-or-cold before rethrowing it. + // The main advantage is both types flow through very similar path + // based on future::handle_exception. + static bool is_class_of(const std::exception_ptr& ep) { + // Seastar offers hacks for making throwing lock-less but stack + // unwinding still can be a problem so painful to justify going + // with non-standard, obscure things like this one. + return *ep.__cxa_exception_type() == typeid(ConcreteExceptionT); + } + }; + + struct EnoentException : public Exception { + using Exception::Exception; + }; + static std::unique_ptr create(const std::string& type, + const std::string& data); + FuturizedStore() = default; + virtual ~FuturizedStore() = default; + + // no copying + explicit FuturizedStore(const FuturizedStore& o) = delete; + const FuturizedStore& operator=(const FuturizedStore& o) = delete; + + virtual seastar::future<> mount() = 0; + virtual seastar::future<> umount() = 0; + + virtual seastar::future<> mkfs() = 0; + using CollectionRef = boost::intrusive_ptr; + virtual seastar::future read(CollectionRef c, + const ghobject_t& oid, + uint64_t offset, + size_t len, + uint32_t op_flags = 0) = 0; + virtual seastar::future get_attr(CollectionRef c, + const ghobject_t& oid, + std::string_view name) = 0; + + using attrs_t = std::map>; + virtual seastar::future get_attrs(CollectionRef c, + const ghobject_t& oid) = 0; + using omap_values_t = std::map>; + using omap_keys_t = std::set; + virtual seastar::future omap_get_values( + CollectionRef c, + const ghobject_t& oid, + const omap_keys_t& keys) = 0; + virtual seastar::future, ghobject_t> list_objects( + CollectionRef c, + const ghobject_t& start, + const ghobject_t& end, + uint64_t limit) = 0; + virtual seastar::future omap_get_values( + CollectionRef c, ///< [in] collection + const ghobject_t &oid, ///< [in] oid + const std::optional &start ///< [in] start, empty for begin + ) = 0; ///< @return values.empty() iff done + + virtual CollectionRef create_new_collection(const coll_t& cid) = 0; + virtual CollectionRef open_collection(const coll_t& cid) = 0; + virtual std::vector list_collections() = 0; + + virtual seastar::future<> do_transaction(CollectionRef ch, + Transaction&& txn) = 0; + + virtual void write_meta(const std::string& key, + const std::string& value) = 0; + virtual int read_meta(const std::string& key, std::string* value) = 0; + virtual uuid_d get_fsid() const = 0; +}; + +} diff --git a/src/crimson/osd/ec_backend.cc b/src/crimson/osd/ec_backend.cc index 510679efa91..66f8dbdff7f 100644 --- a/src/crimson/osd/ec_backend.cc +++ b/src/crimson/osd/ec_backend.cc @@ -3,7 +3,7 @@ ECBackend::ECBackend(shard_id_t shard, ECBackend::CollectionRef coll, - ceph::os::CyanStore* store, + ceph::os::FuturizedStore* store, const ec_profile_t&, uint64_t) : PGBackend{shard, coll, store} diff --git a/src/crimson/osd/ec_backend.h b/src/crimson/osd/ec_backend.h index 6849c2adf2d..4bf6b113a79 100644 --- a/src/crimson/osd/ec_backend.h +++ b/src/crimson/osd/ec_backend.h @@ -13,7 +13,7 @@ class ECBackend : public PGBackend { public: ECBackend(shard_id_t shard, - CollectionRef, ceph::os::CyanStore*, + CollectionRef, ceph::os::FuturizedStore*, const ec_profile_t& ec_profile, uint64_t stripe_width); private: @@ -22,5 +22,5 @@ private: uint64_t len, uint32_t flags) override; CollectionRef coll; - ceph::os::CyanStore* store; + ceph::os::FuturizedStore* store; }; diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 3258b70826f..330b02bc094 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -24,7 +24,7 @@ #include "crimson/net/Messenger.h" #include "crimson/os/cyan_collection.h" #include "crimson/os/cyan_object.h" -#include "crimson/os/cyan_store.h" +#include "crimson/os/futurized_store.h" #include "os/Transaction.h" #include "crimson/osd/heartbeat.h" #include "crimson/osd/osd_meta.h" @@ -42,7 +42,7 @@ namespace { } using ceph::common::local_conf; -using ceph::os::CyanStore; +using ceph::os::FuturizedStore; OSD::OSD(int id, uint32_t nonce, ceph::net::Messenger& cluster_msgr, @@ -58,7 +58,8 @@ OSD::OSD(int id, uint32_t nonce, mgrc{new ceph::mgr::Client{public_msgr, *this}}, heartbeat{new Heartbeat{*this, *monc, hb_front_msgr, hb_back_msgr}}, heartbeat_timer{[this] { update_heartbeat_peers(); }}, - store{std::make_unique( + store{ceph::os::FuturizedStore::create( + local_conf().get_val("osd_objectstore"), local_conf().get_val("osd_data"))}, shard_services{cluster_msgr, public_msgr, *monc, *mgrc, *store} { diff --git a/src/crimson/osd/osd.h b/src/crimson/osd/osd.h index bcab1788108..f8582f79181 100644 --- a/src/crimson/osd/osd.h +++ b/src/crimson/osd/osd.h @@ -44,7 +44,7 @@ namespace ceph::net { } namespace ceph::os { - class CyanStore; + class FuturizedStore; struct Collection; class Transaction; } @@ -74,7 +74,7 @@ class OSD : public ceph::net::Dispatcher, SimpleLRU map_bl_cache; cached_map_t osdmap; // TODO: use a wrapper for ObjectStore - std::unique_ptr store; + std::unique_ptr store; std::unique_ptr meta_coll; OSDState state; diff --git a/src/crimson/osd/osd_meta.cc b/src/crimson/osd/osd_meta.cc index e81455c68c2..f8a270a833c 100644 --- a/src/crimson/osd/osd_meta.cc +++ b/src/crimson/osd/osd_meta.cc @@ -3,7 +3,7 @@ #include #include "crimson/os/cyan_collection.h" -#include "crimson/os/cyan_store.h" +#include "crimson/os/futurized_store.h" #include "os/Transaction.h" void OSDMeta::create(ceph::os::Transaction& t) diff --git a/src/crimson/osd/osd_meta.h b/src/crimson/osd/osd_meta.h index 936d954815f..613e393df56 100644 --- a/src/crimson/osd/osd_meta.h +++ b/src/crimson/osd/osd_meta.h @@ -9,7 +9,7 @@ #include "osd/osd_types.h" namespace ceph::os { - class CyanStore; + class FuturizedStore; class Collection; class Transaction; } @@ -19,12 +19,12 @@ namespace ceph::os { class OSDMeta { template using Ref = boost::intrusive_ptr; - ceph::os::CyanStore* store; + ceph::os::FuturizedStore* store; Ref coll; public: OSDMeta(Ref coll, - ceph::os::CyanStore* store) + ceph::os::FuturizedStore* store) : store{store}, coll{coll} {} diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 3b182c24ffa..dc26142ae03 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -27,7 +27,7 @@ #include "crimson/net/Connection.h" #include "crimson/net/Messenger.h" #include "crimson/os/cyan_collection.h" -#include "crimson/os/cyan_store.h" +#include "crimson/os/futurized_store.h" #include "os/Transaction.h" #include "crimson/osd/exceptions.h" #include "crimson/osd/pg_meta.h" @@ -150,7 +150,7 @@ void PG::init( new_acting_primary, history, pi, backfill, t); } -seastar::future<> PG::read_state(ceph::os::CyanStore* store) +seastar::future<> PG::read_state(ceph::os::FuturizedStore* store) { coll_ref = store->open_collection(coll_t(pgid)); return PGMeta{store, pgid}.load().then( diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index 211fc77053c..109a09ee8d5 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -33,7 +33,7 @@ namespace ceph::net { } namespace ceph::os { - class CyanStore; + class FuturizedStore; } class PG : public boost::intrusive_ref_counter< @@ -385,7 +385,7 @@ public: bool backfill, ObjectStore::Transaction &t); - seastar::future<> read_state(ceph::os::CyanStore* store); + seastar::future<> read_state(ceph::os::FuturizedStore* store); void do_peering_event( const boost::statechart::event_base &evt, diff --git a/src/crimson/osd/pg_backend.cc b/src/crimson/osd/pg_backend.cc index e2e27b45b04..0065a6e8004 100644 --- a/src/crimson/osd/pg_backend.cc +++ b/src/crimson/osd/pg_backend.cc @@ -11,7 +11,7 @@ #include "crimson/os/cyan_collection.h" #include "crimson/os/cyan_object.h" -#include "crimson/os/cyan_store.h" +#include "crimson/os/futurized_store.h" #include "replicated_backend.h" #include "ec_backend.h" #include "exceptions.h" @@ -25,7 +25,7 @@ namespace { std::unique_ptr PGBackend::create(const spg_t pgid, const pg_pool_t& pool, ceph::os::CollectionRef coll, - ceph::os::CyanStore* store, + ceph::os::FuturizedStore* store, const ec_profile_t& ec_profile) { switch (pool.type) { @@ -43,7 +43,7 @@ std::unique_ptr PGBackend::create(const spg_t pgid, PGBackend::PGBackend(shard_id_t shard, CollectionRef coll, - ceph::os::CyanStore* store) + ceph::os::FuturizedStore* store) : shard{shard}, coll{coll}, store{store} @@ -109,7 +109,7 @@ PGBackend::_load_os(const hobject_t& oid) OI_ATTR).then_wrapped([oid, this](auto fut) { if (fut.failed()) { auto ep = std::move(fut).get_exception(); - if (!ceph::os::CyanStore::EnoentException::is_class_of(ep)) { + if (!ceph::os::FuturizedStore::EnoentException::is_class_of(ep)) { std::rethrow_exception(ep); } return seastar::make_ready_future( @@ -138,7 +138,7 @@ PGBackend::_load_ss(const hobject_t& oid) std::unique_ptr snapset; if (fut.failed()) { auto ep = std::move(fut).get_exception(); - if (!ceph::os::CyanStore::EnoentException::is_class_of(ep)) { + if (!ceph::os::FuturizedStore::EnoentException::is_class_of(ep)) { std::rethrow_exception(ep); } else { snapset = std::make_unique(); diff --git a/src/crimson/osd/pg_backend.h b/src/crimson/osd/pg_backend.h index a0d16bb24f4..75f5c30334b 100644 --- a/src/crimson/osd/pg_backend.h +++ b/src/crimson/osd/pg_backend.h @@ -8,7 +8,8 @@ #include #include -#include "crimson/os/cyan_store.h" +#include "crimson/os/futurized_store.h" +#include "crimson/os/cyan_collection.h" #include "crimson/common/shared_lru.h" #include "os/Transaction.h" #include "osd/osd_types.h" @@ -23,12 +24,12 @@ protected: using ec_profile_t = std::map; public: - PGBackend(shard_id_t shard, CollectionRef coll, ceph::os::CyanStore* store); + PGBackend(shard_id_t shard, CollectionRef coll, ceph::os::FuturizedStore* store); virtual ~PGBackend() = default; static std::unique_ptr create(const spg_t pgid, const pg_pool_t& pool, ceph::os::CollectionRef coll, - ceph::os::CyanStore* store, + ceph::os::FuturizedStore* store, const ec_profile_t& ec_profile); using cached_os_t = boost::local_shared_ptr; seastar::future get_object_state(const hobject_t& oid); @@ -57,7 +58,7 @@ public: protected: const shard_id_t shard; CollectionRef coll; - ceph::os::CyanStore* store; + ceph::os::FuturizedStore* store; private: using cached_ss_t = boost::local_shared_ptr; diff --git a/src/crimson/osd/pg_meta.cc b/src/crimson/osd/pg_meta.cc index 979f38f6613..391b3182668 100644 --- a/src/crimson/osd/pg_meta.cc +++ b/src/crimson/osd/pg_meta.cc @@ -3,21 +3,20 @@ #include #include "crimson/os/cyan_collection.h" -#include "crimson/os/cyan_store.h" +#include "crimson/os/futurized_store.h" // prefix pgmeta_oid keys with _ so that PGLog::read_log_and_missing() can // easily skip them +using ceph::os::FuturizedStore; -using ceph::os::CyanStore; - -PGMeta::PGMeta(CyanStore* store, spg_t pgid) +PGMeta::PGMeta(FuturizedStore* store, spg_t pgid) : store{store}, pgid{pgid} {} namespace { template - std::optional find_value(const CyanStore::omap_values_t& values, + std::optional find_value(const FuturizedStore::omap_values_t& values, string_view key) { auto found = values.find(key); @@ -33,10 +32,11 @@ namespace { seastar::future PGMeta::get_epoch() { auto ch = store->open_collection(coll_t{pgid}); + std::set keys{infover_key.data(), + epoch_key.data()}; return store->omap_get_values(ch, pgid.make_pgmeta_oid(), - {string{infover_key}, - string{epoch_key}}).then( + keys).then( [](auto&& values) { { // sanity check @@ -57,12 +57,13 @@ seastar::future PGMeta::get_epoch() seastar::future PGMeta::load() { auto ch = store->open_collection(coll_t{pgid}); + std::set keys{infover_key.data(), + info_key.data(), + biginfo_key.data(), + fastinfo_key.data()}; return store->omap_get_values(ch, pgid.make_pgmeta_oid(), - {string{infover_key}, - string{info_key}, - string{biginfo_key}, - string{fastinfo_key}}).then( + keys).then( [this](auto&& values) { { // sanity check diff --git a/src/crimson/osd/pg_meta.h b/src/crimson/osd/pg_meta.h index 10f2234a792..7baacca89ed 100644 --- a/src/crimson/osd/pg_meta.h +++ b/src/crimson/osd/pg_meta.h @@ -7,16 +7,16 @@ #include "osd/osd_types.h" namespace ceph::os { - class CyanStore; + class FuturizedStore; } /// PG related metadata class PGMeta { - ceph::os::CyanStore* store; + ceph::os::FuturizedStore* store; const spg_t pgid; public: - PGMeta(ceph::os::CyanStore *store, spg_t pgid); + PGMeta(ceph::os::FuturizedStore *store, spg_t pgid); seastar::future get_epoch(); seastar::future load(); }; diff --git a/src/crimson/osd/replicated_backend.cc b/src/crimson/osd/replicated_backend.cc index 81c09c4b320..2a6b9b7fc6e 100644 --- a/src/crimson/osd/replicated_backend.cc +++ b/src/crimson/osd/replicated_backend.cc @@ -2,11 +2,11 @@ #include "crimson/os/cyan_collection.h" #include "crimson/os/cyan_object.h" -#include "crimson/os/cyan_store.h" +#include "crimson/os/futurized_store.h" ReplicatedBackend::ReplicatedBackend(shard_id_t shard, ReplicatedBackend::CollectionRef coll, - ceph::os::CyanStore* store) + ceph::os::FuturizedStore* store) : PGBackend{shard, coll, store} {} diff --git a/src/crimson/osd/replicated_backend.h b/src/crimson/osd/replicated_backend.h index 0a91e03b858..e96060f948f 100644 --- a/src/crimson/osd/replicated_backend.h +++ b/src/crimson/osd/replicated_backend.h @@ -14,7 +14,7 @@ class ReplicatedBackend : public PGBackend public: ReplicatedBackend(shard_id_t shard, CollectionRef coll, - ceph::os::CyanStore* store); + ceph::os::FuturizedStore* store); private: seastar::future _read(const hobject_t& hoid, uint64_t off, diff --git a/src/crimson/osd/shard_services.cc b/src/crimson/osd/shard_services.cc index e36c03c2271..9d4c9984205 100644 --- a/src/crimson/osd/shard_services.cc +++ b/src/crimson/osd/shard_services.cc @@ -31,7 +31,7 @@ ShardServices::ShardServices( ceph::net::Messenger &public_msgr, ceph::mon::Client &monc, ceph::mgr::Client &mgrc, - ceph::os::CyanStore &store) + ceph::os::FuturizedStore &store) : cluster_msgr(cluster_msgr), public_msgr(public_msgr), monc(monc), diff --git a/src/crimson/osd/shard_services.h b/src/crimson/osd/shard_services.h index 719c27e2778..fa3c72b1b0b 100644 --- a/src/crimson/osd/shard_services.h +++ b/src/crimson/osd/shard_services.h @@ -22,7 +22,7 @@ namespace ceph::mon { } namespace ceph::os { - class CyanStore; + class FuturizedStore; } class PerfCounters; @@ -40,7 +40,7 @@ class ShardServices { ceph::net::Messenger &public_msgr; ceph::mon::Client &monc; ceph::mgr::Client &mgrc; - ceph::os::CyanStore &store; + ceph::os::FuturizedStore &store; CephContext cct; @@ -53,14 +53,14 @@ public: ceph::net::Messenger &public_msgr, ceph::mon::Client &monc, ceph::mgr::Client &mgrc, - ceph::os::CyanStore &store); + ceph::os::FuturizedStore &store); seastar::future<> send_to_osd( int peer, MessageRef m, epoch_t from_epoch); - ceph::os::CyanStore &get_store() { + ceph::os::FuturizedStore &get_store() { return store; } diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 622c34a10ec..77bbc8ba624 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -24,7 +24,7 @@ #ifdef WITH_SEASTAR #include -#include "crimson/os/cyan_store.h" +#include "crimson/os/futurized_store.h" #include "crimson/os/cyan_collection.h" #endif @@ -1585,7 +1585,7 @@ public: #ifdef WITH_SEASTAR seastar::future<> read_log_and_missing_crimson( - ceph::os::CyanStore &store, + ceph::os::FuturizedStore &store, ceph::os::CollectionRef ch, const pg_info_t &info, ghobject_t pgmeta_oid @@ -1597,8 +1597,8 @@ public: } template - struct CyanStoreLogReader { - ceph::os::CyanStore &store; + struct FuturizedStoreLogReader { + ceph::os::FuturizedStore &store; ceph::os::CollectionRef ch; const pg_info_t &info; IndexedLog &log; @@ -1667,12 +1667,12 @@ public: on_disk_can_rollback_to = info.last_update; missing.may_include_deletes = false; - auto reader = std::unique_ptr(this); + auto reader = std::unique_ptr(this); return seastar::repeat( [this]() { return store.omap_get_values(ch, pgmeta_oid, next).then( [this]( - bool done, ceph::os::CyanStore::omap_values_t values) { + bool done, ceph::os::FuturizedStore::omap_values_t values) { for (auto &&p : values) { process_entry(p); } @@ -1694,7 +1694,7 @@ public: template static seastar::future<> read_log_and_missing_crimson( - ceph::os::CyanStore &store, + ceph::os::FuturizedStore &store, ceph::os::CollectionRef ch, const pg_info_t &info, IndexedLog &log, @@ -1705,7 +1705,7 @@ public: ldpp_dout(dpp, 20) << "read_log_and_missing coll " << ch->cid << " " << pgmeta_oid << dendl; - return (new CyanStoreLogReader{ + return (new FuturizedStoreLogReader{ store, ch, info, log, missing, pgmeta_oid, dpp})->start(); } -- 2.39.5