namespace crimson::osd {
-seastar::future<core_id_t> PGShardMapping::maybe_create_pg(
+seastar::future<core_id_t> PGShardMapping::get_or_create_pg_mapping(
spg_t pgid,
core_id_t core)
{
}
}
-seastar::future<> PGShardMapping::remove_pg(spg_t pgid) {
+seastar::future<> PGShardMapping::remove_pg_mapping(spg_t pgid) {
return container().invoke_on(0, [pgid](auto &primary_mapping) {
auto iter = primary_mapping.pg_to_core.find(pgid);
ceph_assert_always(iter != primary_mapping.pg_to_core.end());
*
* Maintains a mapping from spg_t to the core containing that PG. Internally, each
* core has a local copy of the mapping to enable core-local lookups. Updates
- * are proxied to core 0, and the back out to all other cores -- see maybe_create_pg.
+ * are proxied to core 0, and the back out to all other cores -- see get_or_create_pg_mapping.
*/
class PGShardMapping : public seastar::peering_sharded_service<PGShardMapping> {
public:
}
/// Returns mapping for pgid, creates new one if it doesn't already exist
- seastar::future<core_id_t> maybe_create_pg(
+ seastar::future<core_id_t> get_or_create_pg_mapping(
spg_t pgid,
core_id_t core = NULL_CORE);
- /// Remove pgid
- seastar::future<> remove_pg(spg_t pgid);
+ /// Remove pgid mapping
+ seastar::future<> remove_pg_mapping(spg_t pgid);
size_t get_num_pgs() const { return pg_to_core.size(); }
auto[coll, shard_core] = coll_core;
spg_t pgid;
if (coll.is_pg(&pgid)) {
- return get_pg_to_shard_mapping().maybe_create_pg(
+ return get_pg_to_shard_mapping().get_or_create_pg_mapping(
pgid, shard_core
).then([this, pgid] (auto core) {
return this->template with_remote_shard_state(
return opref.template enter_stage<>(
opref.get_connection_pipeline().get_pg_mapping);
}).then([this, &opref] {
- return get_pg_to_shard_mapping().maybe_create_pg(opref.get_pgid());
+ return get_pg_to_shard_mapping().get_or_create_pg_mapping(opref.get_pgid());
}).then_wrapped([this, &logger, op=std::move(op)](auto fut) mutable {
if (unlikely(fut.failed())) {
logger.error("{}: failed before with_pg", *op);
auto remove_pg(spg_t pgid) {
local_state.pg_map.remove_pg(pgid);
- return pg_to_shard_mapping.remove_pg(pgid);
+ return pg_to_shard_mapping.remove_pg_mapping(pgid);
}
crimson::common::CephContext *get_cct() {