]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: cancel agent_timer events on shutdown
authorSage Weil <sage@inktank.com>
Fri, 9 May 2014 15:41:33 +0000 (08:41 -0700)
committerSage Weil <sage@redhat.com>
Wed, 23 Jul 2014 22:04:33 +0000 (15:04 -0700)
We need to cancel all agent timer events on shutdown.  This also needs to
happen early so that any in-progress events will execute before we start
flushing and cleaning up PGs.

Backport: firefly
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit c0dc245b662f1f9c640d7dd15fdf4cf26e729782)

Conflicts:
src/osd/OSD.cc

src/osd/OSD.cc
src/osd/OSD.h

index 418c1887e1195ca0a64db0e5a441a49c48453be6..5c8f0d68b833494807894d95ffc8619b92774cba 100644 (file)
@@ -417,6 +417,15 @@ void OSDService::pg_stat_queue_dequeue(PG *pg)
   osd->pg_stat_queue_dequeue(pg);
 }
 
+void OSDService::start_shutdown()
+{
+  {
+    Mutex::Locker l(agent_timer_lock);
+    agent_timer.cancel_all_events();
+    agent_timer.shutdown();
+  }
+}
+
 void OSDService::shutdown()
 {
   reserver_finisher.stop();
@@ -437,10 +446,6 @@ void OSDService::shutdown()
     Mutex::Locker l(backfill_request_lock);
     backfill_request_timer.shutdown();
   }
-  {
-    Mutex::Locker l(agent_timer_lock);
-    agent_timer.shutdown();
-  }
   osdmap = OSDMapRef();
   next_osdmap = OSDMapRef();
 }
@@ -1603,7 +1608,9 @@ int OSD::shutdown()
   cct->_conf->set_val("debug_filestore", "100");
   cct->_conf->set_val("debug_ms", "100");
   cct->_conf->apply_changes(NULL);
-  
+
+  service.start_shutdown();
+
   // Shutdown PGs
   for (ceph::unordered_map<spg_t, PG*>::iterator p = pg_map.begin();
        p != pg_map.end();
index ce8b74c6328c5c85abef01f2f8d7feef8254c770..ae8d74edd92f986c1cae9e715cd25c434cc512c0 100644 (file)
@@ -668,6 +668,7 @@ public:
   void pg_stat_queue_dequeue(PG *pg);
 
   void init();
+  void start_shutdown();
   void shutdown();
 
   // split