From: Kefu Chai Date: Tue, 2 Apr 2019 06:21:38 +0000 (+0800) Subject: crimson/osd: do not store whoami or nonce in Heartbeat X-Git-Tag: v15.0.0~12^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14234491ce74c8cd49b41bddfc44e62a75f94f65;p=ceph.git crimson/osd: do not store whoami or nonce in Heartbeat 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 --- diff --git a/src/crimson/osd/heartbeat.cc b/src/crimson/osd/heartbeat.cc index 8d708b611f60..2ff5270e4d1a 100644 --- a/src/crimson/osd/heartbeat.cc +++ b/src/crimson/osd/heartbeat.cc @@ -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}, diff --git a/src/crimson/osd/heartbeat.h b/src/crimson/osd/heartbeat.h index 2cb3da31c8e4..081c06445ea8 100644 --- a/src/crimson/osd/heartbeat.h +++ b/src/crimson/osd/heartbeat.h @@ -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; diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 7eb59dc88a53..032f2fe1a855 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -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( local_conf().get_val("osd_data"))}