]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: do not store whoami or nonce in Heartbeat
authorKefu Chai <kchai@redhat.com>
Tue, 2 Apr 2019 06:21:38 +0000 (14:21 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 2 Apr 2019 06:25:24 +0000 (14:25 +0800)
we don't create messengers in the class which consumes them anymore, so
no need to have these member variable.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/heartbeat.cc
src/crimson/osd/heartbeat.h
src/crimson/osd/osd.cc

index 8d708b611f60cd59f5e9fd44fc8a75f3adece22d..2ff5270e4d1af669d1717bce0e84a22f4ce3b997 100644 (file)
@@ -28,15 +28,11 @@ namespace {
   }
 }
 
-Heartbeat::Heartbeat(int whoami,
-                     uint32_t nonce,
-                     const OSDMapService& service,
+Heartbeat::Heartbeat(const OSDMapService& service,
                      ceph::mon::Client& monc,
                      ceph::net::Messenger& front_msgr,
                      ceph::net::Messenger& back_msgr)
-  : whoami{whoami},
-    nonce{nonce},
-    service{service},
+  : service{service},
     monc{monc},
     front_msgr{front_msgr},
     back_msgr{back_msgr},
index 2cb3da31c8e4c39611be993f19df55e1009ab1ab..081c06445ea8f6b1da7481c7586d587a93806378 100644 (file)
@@ -22,9 +22,7 @@ class Heartbeat : public ceph::net::Dispatcher {
 public:
   using osd_id_t = int;
 
-  Heartbeat(int whoami,
-           uint32_t nonce,
-           const OSDMapService& service,
+  Heartbeat(const OSDMapService& service,
            ceph::mon::Client& monc,
            ceph::net::Messenger& front_msgr,
            ceph::net::Messenger& back_msgr);
@@ -70,8 +68,6 @@ private:
   seastar::future<> start_messenger(ceph::net::Messenger& msgr,
                                    const entity_addrvec_t& addrs);
 private:
-  const int whoami;
-  const uint32_t nonce;
   const OSDMapService& service;
   ceph::mon::Client& monc;
   ceph::net::Messenger& front_msgr;
index 7eb59dc88a539d99199c21ac2fca5a70c6ce8fac..032f2fe1a855083a8fb14dd549788988c6fa81be 100644 (file)
@@ -61,8 +61,7 @@ OSD::OSD(int id, uint32_t nonce,
     public_msgr{public_msgr},
     monc{new ceph::mon::Client{public_msgr}},
     mgrc{new ceph::mgr::Client{public_msgr, *this}},
-    heartbeat{new Heartbeat{whoami, nonce, *this, *monc,
-                            hb_front_msgr, hb_back_msgr}},
+    heartbeat{new Heartbeat{*this, *monc, hb_front_msgr, hb_back_msgr}},
     heartbeat_timer{[this] { update_heartbeat_peers(); }},
     store{std::make_unique<ceph::os::CyanStore>(
       local_conf().get_val<std::string>("osd_data"))}