]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: use TPHandle in peering_wq
authorSamuel Just <sam.just@inktank.com>
Thu, 24 Jan 2013 19:07:37 +0000 (11:07 -0800)
committerSamuel Just <sam.just@inktank.com>
Fri, 25 Jan 2013 01:25:08 +0000 (17:25 -0800)
Implement _process overload with TPHandle argument and use
that to ping the hb map between pgs and between map epochs
when advancing a pg.  The thread will still timeout if
genuinely stuck at any point.

Fixes: 3905
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/OSD.cc
src/osd/OSD.h

index 82a9a54e281e01068d56674e615e77874b69afab..9541517e37b7f86e949de86612c3407d5fe67526 100644 (file)
@@ -4214,7 +4214,9 @@ void OSD::check_osdmap_features()
 }
 
 void OSD::advance_pg(
-  epoch_t osd_epoch, PG *pg, PG::RecoveryCtx *rctx,
+  epoch_t osd_epoch, PG *pg,
+  ThreadPool::TPHandle &handle,
+  PG::RecoveryCtx *rctx,
   set<boost::intrusive_ptr<PG> > *new_pgs)
 {
   assert(pg->is_locked());
@@ -4246,6 +4248,7 @@ void OSD::advance_pg(
     }
 
     lastmap = nextmap;
+    handle.reset_tp_timeout();
   }
   if (!is_booting())
     pg->handle_activate_map(rctx);
@@ -6353,7 +6356,10 @@ struct C_CompleteSplits : public Context {
   }
 };
 
-void OSD::process_peering_events(const list<PG*> &pgs)
+void OSD::process_peering_events(
+  const list<PG*> &pgs,
+  ThreadPool::TPHandle &handle
+  )
 {
   bool need_up_thru = false;
   epoch_t same_interval_since = 0;
@@ -6370,7 +6376,7 @@ void OSD::process_peering_events(const list<PG*> &pgs)
       pg->unlock();
       continue;
     }
-    advance_pg(curmap->get_epoch(), pg, &rctx, &split_pgs);
+    advance_pg(curmap->get_epoch(), pg, handle, &rctx, &split_pgs);
     if (!pg->peering_queue.empty()) {
       PG::CephPeeringEvtRef evt = pg->peering_queue.front();
       pg->peering_queue.pop_front();
@@ -6391,6 +6397,7 @@ void OSD::process_peering_events(const list<PG*> &pgs)
       dispatch_context_transaction(rctx, pg);
     }
     pg->unlock();
+    handle.reset_tp_timeout();
   }
   if (need_up_thru)
     queue_want_up_thru(same_interval_since);
index 1fb34aac6108700bc853b68240a53f346b847ded..23b95e89147321e4efa8e85b968f131e97125ec5 100644 (file)
@@ -742,8 +742,10 @@ private:
       }
       in_use.insert(got.begin(), got.end());
     }
-    void _process(const list<PG *> &pgs) {
-      osd->process_peering_events(pgs);
+    void _process(
+      const list<PG *> &pgs,
+      ThreadPool::TPHandle &handle) {
+      osd->process_peering_events(pgs, handle);
       for (list<PG *>::const_iterator i = pgs.begin();
           i != pgs.end();
           ++i) {
@@ -762,7 +764,9 @@ private:
     }
   } peering_wq;
 
-  void process_peering_events(const list<PG*> &pg);
+  void process_peering_events(
+    const list<PG*> &pg,
+    ThreadPool::TPHandle &handle);
 
   friend class PG;
   friend class ReplicatedPG;
@@ -797,8 +801,11 @@ private:
   void note_up_osd(int osd);
   
   void advance_pg(
-    epoch_t advance_to, PG *pg, PG::RecoveryCtx *rctx,
-    set<boost::intrusive_ptr<PG> > *split_pgs);
+    epoch_t advance_to, PG *pg,
+    ThreadPool::TPHandle &handle,
+    PG::RecoveryCtx *rctx,
+    set<boost::intrusive_ptr<PG> > *split_pgs
+  );
   void advance_map(ObjectStore::Transaction& t, C_Contexts *tfin);
   void consume_map();
   void activate_map();