]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add reset_tp_timeout in long loop in add_source_info for suicide timeout 2650/head
authorluowei <luowei@yahoo-inc.com>
Thu, 11 Sep 2014 07:43:13 +0000 (07:43 +0000)
committerSage Weil <sage@redhat.com>
Tue, 7 Oct 2014 00:49:12 +0000 (17:49 -0700)
Fixes: #9128
Signed-off-by: luowei@yahoo-inc.com
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h

index a53dfca4859ca27aba6592a4d14feb05d49456a1..cecfdf1f3ed3b3de11488849a62d9aac31d7084a 100644 (file)
@@ -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<PG*>::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);
     }
index 40b205c403e271d4d1b67351b0ad7a42fb01fb41..cecce916d263d945cb043ba94c1430590a19278c 100644 (file)
@@ -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<pg_shard_t>::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<pg_shard_t, pg_missing_t>::iterator i = peer_missing.begin();
           i != peer_missing.end();
index 6265ad4d6022929d51b596837600ea86490c1582..c6af5e347e58551950571d8c771ee44592744469 100644 (file)
@@ -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<int, map<spg_t, pg_query_t> > *query_map,
                map<int,
                    vector<pair<pg_notify_t, pg_interval_map_t> > > *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);