From: luowei Date: Thu, 11 Sep 2014 07:43:13 +0000 (+0000) Subject: Add reset_tp_timeout in long loop in add_source_info for suicide timeout X-Git-Tag: v0.87~30^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6aba0ab9a8bc52bf07fd1cfd1dfd0f1915c8bd26;p=ceph.git Add reset_tp_timeout in long loop in add_source_info for suicide timeout Fixes: #9128 Signed-off-by: luowei@yahoo-inc.com --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a53dfca4859c..cecfdf1f3ed3 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7850,6 +7850,7 @@ void OSD::do_recovery(PG *pg, ThreadPool::TPHandle &handle) #endif PG::RecoveryCtx rctx = create_context(); + rctx.handle = &handle; int started; bool more = pg->start_recovery_ops(max, &rctx, handle, &started); @@ -8427,6 +8428,7 @@ void OSD::process_peering_events( epoch_t same_interval_since = 0; OSDMapRef curmap = service.get_osdmap(); PG::RecoveryCtx rctx = create_context(); + rctx.handle = &handle; for (list::const_iterator i = pgs.begin(); i != pgs.end(); ++i) { @@ -8456,6 +8458,7 @@ void OSD::process_peering_events( if (compat_must_dispatch_immediately(pg)) { dispatch_context(rctx, pg, curmap, &handle); rctx = create_context(); + rctx.handle = &handle; } else { dispatch_context_transaction(rctx, pg, &handle); } diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 40b205c403e2..cecce916d263 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -401,7 +401,7 @@ bool PG::search_for_missing( { unsigned num_unfound_before = missing_loc.num_unfound(); bool found_missing = missing_loc.add_source_info( - from, oinfo, omissing); + from, oinfo, omissing, ctx->handle); if (found_missing && num_unfound_before != missing_loc.num_unfound()) publish_stats_to_osd(); if (found_missing && @@ -441,7 +441,8 @@ bool PG::MissingLoc::readable_with_acting( bool PG::MissingLoc::add_source_info( pg_shard_t fromosd, const pg_info_t &oinfo, - const pg_missing_t &omissing) + const pg_missing_t &omissing, + ThreadPool::TPHandle* handle) { bool found_missing = false; // found items? @@ -450,6 +451,9 @@ bool PG::MissingLoc::add_source_info( ++p) { const hobject_t &soid(p->first); eversion_t need = p->second.need; + if (handle) { + handle->reset_tp_timeout(); + } if (oinfo.last_update < need) { dout(10) << "search_for_missing " << soid << " " << need << " also missing on osd." << fromosd @@ -1632,7 +1636,7 @@ void PG::activate(ObjectStore::Transaction& t, // past intervals. might_have_unfound.clear(); if (needs_recovery()) { - missing_loc.add_source_info(pg_whoami, info, pg_log.get_missing()); + missing_loc.add_source_info(pg_whoami, info, pg_log.get_missing(), ctx->handle); for (set::iterator i = actingbackfill.begin(); i != actingbackfill.end(); ++i) { @@ -1643,7 +1647,8 @@ void PG::activate(ObjectStore::Transaction& t, missing_loc.add_source_info( *i, peer_info[*i], - peer_missing[*i]); + peer_missing[*i], + ctx->handle); } for (map::iterator i = peer_missing.begin(); i != peer_missing.end(); diff --git a/src/osd/PG.h b/src/osd/PG.h index 6265ad4d6022..c6af5e347e58 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -393,7 +393,8 @@ public: bool add_source_info( pg_shard_t source, ///< [in] source const pg_info_t &oinfo, ///< [in] info - const pg_missing_t &omissing ///< [in] (optional) missing + const pg_missing_t &omissing, ///< [in] (optional) missing + ThreadPool::TPHandle* handle ///< [in] ThreadPool handle ); ///< @return whether a new object location was discovered /// Uses osdmap to update structures for now down sources @@ -519,6 +520,7 @@ public: C_Contexts *on_applied; C_Contexts *on_safe; ObjectStore::Transaction *transaction; + ThreadPool::TPHandle* handle; RecoveryCtx(map > *query_map, map > > *info_map, @@ -531,7 +533,8 @@ public: notify_list(notify_list), on_applied(on_applied), on_safe(on_safe), - transaction(transaction) {} + transaction(transaction), + handle(NULL) {} RecoveryCtx(BufferedRecoveryMessages &buf, RecoveryCtx &rctx) : query_map(&(buf.query_map)), @@ -539,7 +542,8 @@ public: notify_list(&(buf.notify_list)), on_applied(rctx.on_applied), on_safe(rctx.on_safe), - transaction(rctx.transaction) {} + transaction(rctx.transaction), + handle(NULL) {} void accept_buffered_messages(BufferedRecoveryMessages &m) { assert(query_map);