From: Sage Weil Date: Fri, 9 May 2014 15:41:33 +0000 (-0700) Subject: osd: cancel agent_timer events on shutdown X-Git-Tag: v0.80.5~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b576d5a242c16bc9e38ba283a9784f838614882a;p=ceph.git osd: cancel agent_timer events on shutdown 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 (cherry picked from commit c0dc245b662f1f9c640d7dd15fdf4cf26e729782) Conflicts: src/osd/OSD.cc --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 418c1887e119..5c8f0d68b833 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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::iterator p = pg_map.begin(); p != pg_map.end(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index ce8b74c6328c..ae8d74edd92f 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -668,6 +668,7 @@ public: void pg_stat_queue_dequeue(PG *pg); void init(); + void start_shutdown(); void shutdown(); // split