From ca9f71300471e1947be63e5dfad1a4800c1ffc9c Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 18 Jul 2012 11:31:09 -0700 Subject: [PATCH] OSD: actually send queries during handle_pg_create During the osd threading refactor, we lost the do_queries call in favor of dispatch_context. However, this did not include the queries triggered prior to pg instantiation. Instead, use the rctx to send the queries. Part of #2771. Without the queries being sent, can_create_pg will never become true. Signed-off-by: Samuel Just --- src/osd/OSD.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 17e14f4ff6f18..2e71ea62f032d 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4099,9 +4099,6 @@ void OSD::handle_pg_create(OpRequestRef op) op->mark_started(); - map< int, map > query_map; - map > > info_map; - int num_created = 0; for (map::iterator p = m->mkpg.begin(); @@ -4168,6 +4165,7 @@ void OSD::handle_pg_create(OpRequestRef op) calc_priors_during(pgid, created, history.same_interval_since, creating_pgs[pgid].prior); + PG::RecoveryCtx rctx = create_context(); // poll priors set& pset = creating_pgs[pgid].prior; dout(10) << "mkpg " << pgid << " e" << created @@ -4175,13 +4173,13 @@ void OSD::handle_pg_create(OpRequestRef op) << " : querying priors " << pset << dendl; for (set::iterator p = pset.begin(); p != pset.end(); p++) if (osdmap->is_up(*p)) - query_map[*p][pgid] = pg_query_t(pg_query_t::INFO, history, - osdmap->get_epoch()); - + (*rctx.query_map)[*p][pgid] = pg_query_t(pg_query_t::INFO, history, + osdmap->get_epoch()); + + PG *pg = NULL; if (can_create_pg(pgid)) { pg_interval_map_t pi; - PG::RecoveryCtx rctx = create_context(); - PG *pg = _create_lock_pg( + pg = _create_lock_pg( osdmap, pgid, true, false, 0, creating_pgs[pgid].acting, creating_pgs[pgid].acting, history, pi, @@ -4192,9 +4190,9 @@ void OSD::handle_pg_create(OpRequestRef op) pg->write_if_dirty(*rctx.transaction); pg->update_stats(); pg->unlock(); - dispatch_context(rctx, pg, osdmap); num_created++; } + dispatch_context(rctx, pg, osdmap); } maybe_update_heartbeat_peers(); -- 2.39.5