]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: shutdown our reserver_finisher earlier in the process
authorGreg Farnum <gfarnum@redhat.com>
Fri, 26 May 2017 05:14:38 +0000 (22:14 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 26 May 2017 21:43:26 +0000 (14:43 -0700)
This finisher thread has a lot of callbacks which can hold PGRefs. Make
sure we drain them out before checking that all the PGs have finished
and have no outstanding references.

Moving this should be safe; we've already stopped the op thread et al
and the only things still running are the OSDService's objecter_finisher,
recovery_request_timer, and snap_sleep_timer (which has definitely been emptied
by the time we get here as it's synchronously cleared out on PG shutdown).

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 0c88a8714f438d17117df6d6bb11b005a77a0b73..40a7c685875db7fcac836336ca36c25651e20a61 100644 (file)
@@ -515,10 +515,14 @@ void OSDService::start_shutdown()
   }
 }
 
-void OSDService::shutdown()
+void OSDService::shutdown_reserver()
 {
   reserver_finisher.wait_for_empty();
   reserver_finisher.stop();
+}
+
+void OSDService::shutdown()
+{
   {
     Mutex::Locker l(watch_lock);
     watch_timer.shutdown();
@@ -3210,6 +3214,8 @@ int OSD::shutdown()
     assert(pg_stat_queue.empty());
   }
 
+  service.shutdown_reserver();
+
   // Remove PGs
 #ifdef PG_DEBUG_REFS
   service.dump_live_pgids();
index 0b6cedd09f17fbfbd4cef83fbac644b685b745d7..6a8bcb5b9de871d9710962d70b23c8c248d70885 100644 (file)
@@ -1100,6 +1100,7 @@ public:
   void init();
   void final_init();  
   void start_shutdown();
+  void shutdown_reserver();
   void shutdown();
 
 private: