]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/scrub: destruct the scrubber shortly before the PG is destructed 42951/head
authorRonen Friedman <rfriedma@redhat.com>
Thu, 26 Aug 2021 12:30:38 +0000 (12:30 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Sat, 28 Aug 2021 10:24:49 +0000 (13:24 +0300)
By destructing the scrubber when the PG is still intact, we guarantee that
Scrubber's code can refer to the PG object - especially in dout()s.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 9df12b9012bebdf179787d105cd5c9b1d7b06250..6b1a3e52f45b6b8cd93d7cdd4e52798d328240e5 100644 (file)
@@ -1756,6 +1756,11 @@ PrimaryLogPG::PrimaryLogPG(OSDService *o, OSDMapRef curmap,
   m_scrubber = make_unique<PrimaryLogScrub>(this);
 }
 
+PrimaryLogPG::~PrimaryLogPG()
+{
+  m_scrubber.reset();
+}
+
 void PrimaryLogPG::get_src_oloc(const object_t& oid, const object_locator_t& oloc, object_locator_t& src_oloc)
 {
   src_oloc = oloc;
index d7d075c77af0778e50b7129ba44e5f600e800ec0..23ecdffda6396f7aa1df9d26dd32ff1aa5bcfa72 100644 (file)
@@ -1475,7 +1475,7 @@ public:
               const PGPool &_pool,
               const std::map<std::string,std::string>& ec_profile,
               spg_t p);
-  ~PrimaryLogPG() override {}
+  ~PrimaryLogPG() override;
 
   void do_command(
     const std::string_view& prefix,