Skip to content

Commit

Permalink
crimson/osd: put snapmapper's key-value pairs into dedicated objs
Browse files Browse the repository at this point in the history
Otherwise, PG::read_log_and_missing() will meet those key-values and
won't know what to do with them. This is modeling what the classic
osd is doing

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
  • Loading branch information
xxhdx1985126 committed Oct 7, 2023
1 parent b05d167 commit f5f718e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/crimson/osd/pg.cc
Expand Up @@ -145,7 +145,7 @@ PG::PG(
osdriver(
&shard_services.get_store(),
coll_ref,
pgid.make_pgmeta_oid()),
make_snapmapper_oid()),
snap_mapper(
this->shard_services.get_cct(),
&osdriver,
Expand Down Expand Up @@ -610,6 +610,8 @@ void PG::init(
peering_state.init(
role, newup, new_up_primary, newacting,
new_acting_primary, history, pi, t);
assert(coll_ref);
t.touch(coll_ref->get_cid(), make_snapmapper_oid());
}

seastar::future<> PG::read_state(crimson::os::FuturizedStore::Shard* store)
Expand Down
6 changes: 6 additions & 0 deletions src/crimson/osd/pg.h
Expand Up @@ -632,6 +632,12 @@ class PG : public boost::intrusive_ref_counter<
OSDriver osdriver;
SnapMapper snap_mapper;

ghobject_t make_snapmapper_oid() {
return ghobject_t(hobject_t(
sobject_t(
object_t("snapmapper"),
0)));
}
public:
// PeeringListener
void publish_stats_to_osd() final;
Expand Down

0 comments on commit f5f718e

Please sign in to comment.