From becdbe2917962b9cb014f9030a20b4a5c2cafc59 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Fri, 8 Jul 2016 18:32:21 -0700 Subject: [PATCH] ReplicatedPG: clear log update waiters during shutdown This prevents leaking repops that are referenced by LogUpdateCtx for updates that were in flight. Signed-off-by: Josh Durgin --- src/osd/ReplicatedPG.cc | 8 ++++++++ src/osd/ReplicatedPG.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 47f9f945966..732131afa26 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -8791,6 +8791,13 @@ void ReplicatedPG::submit_log_entries( assert(r == 0); } +void ReplicatedPG::cancel_log_updates() +{ + // get rid of all the LogUpdateCtx so their references to repops are + // dropped + log_entry_update_waiting_on.clear(); +} + // ------------------------------------------------------- void ReplicatedPG::get_watchers(list &pg_watchers) @@ -10027,6 +10034,7 @@ void ReplicatedPG::on_shutdown() cancel_flush_ops(false); cancel_proxy_ops(false); apply_and_flush_repops(false); + cancel_log_updates(); pgbackend->on_change(); diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index dd860c7708c..faf85ffb217 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -915,6 +915,7 @@ protected: boost::intrusive_ptr repop; set waiting_on; }; + void cancel_log_updates(); map log_entry_update_waiting_on; -- 2.47.3