From: Chunmei Liu Date: Wed, 1 Oct 2025 22:33:12 +0000 (+0000) Subject: crimson/os/alienstore: support multiple store shards on each reactor X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2feaa5ba20e2e34cc5e4f95116afc5da603407ef;p=ceph-ci.git crimson/os/alienstore: support multiple store shards on each reactor Signed-off-by: Chunmei Liu --- diff --git a/src/crimson/common/smp_helpers.h b/src/crimson/common/smp_helpers.h index 923d6434cfa..362edf00d2c 100644 --- a/src/crimson/common/smp_helpers.h +++ b/src/crimson/common/smp_helpers.h @@ -21,6 +21,9 @@ namespace crimson { using core_id_t = seastar::shard_id; static constexpr core_id_t NULL_CORE = std::numeric_limits::max(); +static constexpr unsigned int NULL_STORE_INDEX = std::numeric_limits::max(); +static constexpr uint32_t GLOBAL_STORE = std::numeric_limits::max(); +static constexpr unsigned int DEFAULT_STORE_INDEX = 0; /** * submit_to diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index 65b8f061e64..3affe28170b 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -84,7 +84,7 @@ AlienStore::~AlienStore() { } -seastar::future<> AlienStore::start() +seastar::future AlienStore::start() { cct = std::make_unique( CEPH_ENTITY_TYPE_OSD, @@ -119,7 +119,9 @@ seastar::future<> AlienStore::start() const auto num_threads = get_conf("crimson_bluestore_num_threads"); tp = std::make_unique(num_threads, 128, alien_thread_cpu_cores); - return tp->start(); + return tp->start().then([]() { + return seastar::make_ready_future(seastar::smp::count); + }); } seastar::future<> AlienStore::stop() @@ -273,7 +275,7 @@ seastar::future> AlienStore::list_collections() ret.resize(ls.size()); std::transform( ls.begin(), ls.end(), ret.begin(), - [](auto p) { return std::make_pair(p, NULL_CORE); }); + [](auto p) { return std::make_pair(p, std::make_pair(NULL_CORE, NULL_STORE_INDEX)); }); return seastar::make_ready_future>(std::move(ret)); }); }); diff --git a/src/crimson/os/alienstore/alien_store.h b/src/crimson/os/alienstore/alien_store.h index 613501fffe0..9fe062b2f3a 100644 --- a/src/crimson/os/alienstore/alien_store.h +++ b/src/crimson/os/alienstore/alien_store.h @@ -29,7 +29,7 @@ public: const ConfigValues& values); ~AlienStore() final; - seastar::future<> start() final; + seastar::future start() final; seastar::future<> stop() final; mount_ertr::future<> mount() final; seastar::future<> umount() final; @@ -48,7 +48,6 @@ public: const ghobject_t& oid, interval_set& m, uint32_t op_flags = 0) final; - get_attr_errorator::future get_attr( CollectionRef c, @@ -118,7 +117,11 @@ public: uint64_t len, uint32_t op_flags) final; - FuturizedStore::Shard& get_sharded_store() final { + BackendStore get_backend_store(uint32_t store_index = NULL_STORE_INDEX) final { + return BackendStore(*this, GLOBAL_STORE, store_index); + } + + FuturizedStore::Shard& get_sharded_store(uint32_t store_index) final { return *this; }