]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: actually send queries during handle_pg_create
authorSamuel Just <sam.just@inktank.com>
Wed, 18 Jul 2012 18:31:09 +0000 (11:31 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 18 Jul 2012 21:26:16 +0000 (14:26 -0700)
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 <sam.just@inktank.com>
src/osd/OSD.cc

index 17e14f4ff6f1860c6f9a0b3ccc10775996bd415e..2e71ea62f032d68d3da70efd68cdc5989b8dda32 100644 (file)
@@ -4099,9 +4099,6 @@ void OSD::handle_pg_create(OpRequestRef op)
 
   op->mark_started();
 
-  map< int, map<pg_t,pg_query_t> > query_map;
-  map<int,vector<pair<pg_notify_t, pg_interval_map_t> > > info_map;
-
   int num_created = 0;
 
   for (map<pg_t,pg_create_t>::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<int>& 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<int>::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();