From: Kefu Chai Date: Tue, 4 Jul 2017 02:45:44 +0000 (+0800) Subject: osd: clear_queued_recovery() in on_shutdown() X-Git-Tag: v12.1.1~198^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16093%2Fhead;p=ceph.git osd: clear_queued_recovery() in on_shutdown() otherwise when we are kicking the PG waiting in OSD's awaiting_throttle queue, the queue is still holding a strong reference of it. then we will have warnings like "pgid 0.7 has ref count of 2" when shutting down OSD, because pgmap is also holding a reference of it. we could clear the "awaiting_throttle" directly in OSD::shutdown(), but clear_queued_recovery() is more consistent this way, because it is PG which registered itself to the queue in OSD, it'd be better if PG can remove itself from the OSD when it is shutting down itself. Fixes: http://tracker.ceph.com/issues/20432 Signed-off-by: Kefu Chai --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 15fe105b3336..b59a57d8ebaa 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -10661,6 +10661,11 @@ void PrimaryLogPG::on_shutdown() // handles queue races deleting = true; + if (recovery_queued) { + recovery_queued = false; + osd->clear_queued_recovery(this); + } + clear_scrub_reserved(); scrub_clear_state();