mirror of
https://github.com/ceph/ceph
synced 2025-01-11 13:41:02 +00:00
Merge pull request #27426 from tchaikov/wip-crimson-setup-msgr
crimson/osd: consolidate the code to initialize msgrs Reviewed-by: Samuel Just <sjust@redhat.com> Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
This commit is contained in:
commit
a866d16095
@ -59,12 +59,6 @@ seastar::future<>
|
||||
Heartbeat::start_messenger(ceph::net::Messenger& msgr,
|
||||
const entity_addrvec_t& addrs)
|
||||
{
|
||||
if (local_conf()->ms_crc_data) {
|
||||
msgr.set_crc_data();
|
||||
}
|
||||
if (local_conf()->ms_crc_header) {
|
||||
msgr.set_crc_header();
|
||||
}
|
||||
return msgr.try_bind(addrs,
|
||||
local_conf()->ms_bind_port_min,
|
||||
local_conf()->ms_bind_port_max).then([&msgr, this] {
|
||||
|
@ -101,11 +101,19 @@ int main(int argc, char* argv[])
|
||||
local_conf().parse_argv(ceph_args).get();
|
||||
const int whoami = std::stoi(local_conf()->name.get_id());
|
||||
const auto nonce = static_cast<uint32_t>(getpid());
|
||||
const auto shard = seastar::engine().cpu_id();
|
||||
cluster_msgr.start(entity_name_t::OSD(whoami), "cluster"s, nonce, shard).get();
|
||||
client_msgr.start(entity_name_t::OSD(whoami), "client"s, nonce, shard).get();
|
||||
hb_front_msgr.start(entity_name_t::OSD(whoami), "hb_front"s, nonce, shard).get();
|
||||
hb_back_msgr.start(entity_name_t::OSD(whoami), "hb_back"s, nonce, shard).get();
|
||||
for (auto [msgr, name] : {make_pair(std::ref(cluster_msgr), "cluster"s),
|
||||
make_pair(std::ref(client_msgr), "client"s),
|
||||
make_pair(std::ref(hb_front_msgr), "hb_front"s),
|
||||
make_pair(std::ref(hb_back_msgr), "hb_back"s)}) {
|
||||
const auto shard = seastar::engine().cpu_id();
|
||||
msgr.start(entity_name_t::OSD(whoami), name, nonce, shard).get();
|
||||
if (local_conf()->ms_crc_data) {
|
||||
msgr.local().set_crc_data();
|
||||
}
|
||||
if (local_conf()->ms_crc_header) {
|
||||
msgr.local().set_crc_header();
|
||||
}
|
||||
}
|
||||
osd.start_single(whoami, nonce,
|
||||
reference_wrapper<ceph::net::Messenger>(cluster_msgr.local()),
|
||||
reference_wrapper<ceph::net::Messenger>(client_msgr.local()),
|
||||
|
@ -185,14 +185,6 @@ seastar::future<> OSD::start()
|
||||
osdmap = std::move(map);
|
||||
return load_pgs();
|
||||
}).then([this] {
|
||||
for (auto msgr : {std::ref(cluster_msgr), std::ref(public_msgr)}) {
|
||||
if (local_conf()->ms_crc_data) {
|
||||
msgr.get().set_crc_data();
|
||||
}
|
||||
if (local_conf()->ms_crc_header) {
|
||||
msgr.get().set_crc_header();
|
||||
}
|
||||
}
|
||||
dispatchers.push_front(this);
|
||||
dispatchers.push_front(monc.get());
|
||||
dispatchers.push_front(mgrc.get());
|
||||
|
Loading…
Reference in New Issue
Block a user