From: Greg Farnum Date: Fri, 26 May 2017 05:14:38 +0000 (-0700) Subject: osd: shutdown our reserver_finisher earlier in the process X-Git-Tag: v11.2.1~21^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4bf34200896ce120bba2e2d974c4f3dadb342821;p=ceph.git osd: shutdown our reserver_finisher earlier in the process 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 (cherry picked from commit 66ea9c1f66ae31035e62bd4335b08948b1e8e5e2) --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 25f7307959c..7ac7396686b 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -510,10 +510,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(); @@ -2849,6 +2853,8 @@ int OSD::shutdown() assert(pg_stat_queue.empty()); } + service.shutdown_reserver(); + // Remove PGs #ifdef PG_DEBUG_REFS service.dump_live_pgids(); diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 8fa969d3a3e..3e800846aba 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1039,6 +1039,7 @@ public: void init(); void final_init(); void start_shutdown(); + void shutdown_reserver(); void shutdown(); private: