From: Samuel Just Date: Thu, 24 Jan 2013 19:07:37 +0000 (-0800) Subject: OSD: use TPHandle in peering_wq X-Git-Tag: v0.57~127 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e0511f4f4773766d04e845af2d079f82f3177cb6;p=ceph.git OSD: use TPHandle in peering_wq 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 82a9a54e281e..9541517e37b7 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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 > *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 &pgs) +void OSD::process_peering_events( + const list &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 &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 &pgs) dispatch_context_transaction(rctx, pg); } pg->unlock(); + handle.reset_tp_timeout(); } if (need_up_thru) queue_want_up_thru(same_interval_since); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 1fb34aac6108..23b95e891473 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -742,8 +742,10 @@ private: } in_use.insert(got.begin(), got.end()); } - void _process(const list &pgs) { - osd->process_peering_events(pgs); + void _process( + const list &pgs, + ThreadPool::TPHandle &handle) { + osd->process_peering_events(pgs, handle); for (list::const_iterator i = pgs.begin(); i != pgs.end(); ++i) { @@ -762,7 +764,9 @@ private: } } peering_wq; - void process_peering_events(const list &pg); + void process_peering_events( + const list &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 > *split_pgs); + epoch_t advance_to, PG *pg, + ThreadPool::TPHandle &handle, + PG::RecoveryCtx *rctx, + set > *split_pgs + ); void advance_map(ObjectStore::Transaction& t, C_Contexts *tfin); void consume_map(); void activate_map();