From 922a855817e520f2a84a016b27031a719bf07cf9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 5 Apr 2018 21:47:48 -0500 Subject: [PATCH] osd: legacy pg_create creates pg in current epoch For the legacy create path, we pregenerate the history and instantiate the PG at the current epoch. Signed-off-by: Sage Weil --- src/osd/OSD.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 20b27076acd..21f447239a7 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3927,13 +3927,13 @@ PGRef OSD::handle_pg_create_info(const OSDMapRef& osdmap, PG::RecoveryCtx rctx = create_context(); - OSDMapRef createmap = get_map(info->epoch); + OSDMapRef startmap = get_map(info->epoch); int up_primary, acting_primary; vector up, acting; - createmap->pg_to_up_acting_osds( + startmap->pg_to_up_acting_osds( pgid.pgid, &up, &up_primary, &acting, &acting_primary); - const pg_pool_t* pp = createmap->get_pg_pool(pgid.pool()); + const pg_pool_t* pp = startmap->get_pg_pool(pgid.pool()); if (pp->has_flag(pg_pool_t::FLAG_EC_OVERWRITES) && store->get_type() != "bluestore") { clog->warn() << "pg " << pgid @@ -3944,12 +3944,12 @@ PGRef OSD::handle_pg_create_info(const OSDMapRef& osdmap, PG::_create(*rctx.transaction, pgid, pgid.get_split_bits(pp->get_pg_num())); PG::_init(*rctx.transaction, pgid, pp); - int role = createmap->calc_pg_role(whoami, acting, acting.size()); + int role = startmap->calc_pg_role(whoami, acting, acting.size()); if (!pp->is_replicated() && role != pgid.shard) { role = -1; } - PGRef pg = _make_pg(createmap, pgid); + PGRef pg = _make_pg(startmap, pgid); pg->ch = store->create_new_collection(pg->coll); pg->lock(true); @@ -8172,7 +8172,7 @@ void OSD::handle_pg_create(OpRequestRef op) true, new PGCreateInfo( pgid, - created, + osdmap->get_epoch(), history, pi, true) -- 2.39.5