crimson/osd: move store responsiblity to PerShardState

Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Samuel Just 2022-08-24 23:50:57 +00:00
parent 2b5c471913
commit 12042dcbc7
3 changed files with 13 additions and 13 deletions

View File

@ -20,14 +20,14 @@ PGShardManager::PGShardManager(
crimson::mgr::Client &mgrc,
crimson::os::FuturizedStore &store)
: osd_singleton_state(whoami, cluster_msgr, public_msgr,
monc, mgrc, store),
local_state(whoami),
monc, mgrc),
local_state(whoami, store),
shard_services(osd_singleton_state, local_state)
{}
seastar::future<> PGShardManager::load_pgs()
{
return osd_singleton_state.store.list_collections(
return local_state.store.list_collections(
).then([this](auto colls) {
return seastar::parallel_for_each(
colls,

View File

@ -34,8 +34,10 @@ using std::vector;
namespace crimson::osd {
PerShardState::PerShardState(
int whoami)
int whoami,
crimson::os::FuturizedStore &store)
: whoami(whoami),
store(store),
throttler(crimson::common::local_conf()),
obc_registry(crimson::common::local_conf())
{
@ -94,15 +96,13 @@ OSDSingletonState::OSDSingletonState(
crimson::net::Messenger &cluster_msgr,
crimson::net::Messenger &public_msgr,
crimson::mon::Client &monc,
crimson::mgr::Client &mgrc,
crimson::os::FuturizedStore &store)
crimson::mgr::Client &mgrc)
: whoami(whoami),
osdmap_gate("OSDSingletonState::osdmap_gate"),
cluster_msgr(cluster_msgr),
public_msgr(public_msgr),
monc(monc),
mgrc(mgrc),
store(store),
local_reserver(
&cct,
&finisher,

View File

@ -59,6 +59,7 @@ class PerShardState {
using local_cached_map_t = OSDMapService::local_cached_map_t;
const int whoami;
crimson::os::FuturizedStore &store;
crimson::common::CephContext cct;
PerfCounters *perf = nullptr;
@ -122,7 +123,9 @@ class PerShardState {
return std::make_pair(std::move(op), std::move(fut));
}
PerShardState(int whoami);
PerShardState(
int whoami,
crimson::os::FuturizedStore &store);
};
/**
@ -143,8 +146,7 @@ public:
crimson::net::Messenger &cluster_msgr,
crimson::net::Messenger &public_msgr,
crimson::mon::Client &monc,
crimson::mgr::Client &mgrc,
crimson::os::FuturizedStore &store);
crimson::mgr::Client &mgrc);
const int whoami;
@ -172,8 +174,6 @@ public:
crimson::mgr::Client &mgrc;
crimson::os::FuturizedStore &store;
// tids for ops i issue
unsigned int next_tid{0};
ceph_tid_t get_tid() {
@ -302,7 +302,7 @@ public:
FORWARD_TO_OSD_SINGLETON(send_to_osd)
crimson::os::FuturizedStore &get_store() {
return osd_singleton_state.store;
return local_state.store;
}
crimson::common::CephContext *get_cct() {