in teuthology tests, there is good chance that we have ceph.conf
containing:
mon host = 172.21.15.122
which is translated to two monitors
- a: 172.21.15.122:3300
- a-legacy: 172.21.15.122:6789
both has protocol type of "any". so, to enable crimson to use settings
like this, we should let crimson to accept them, and drop the connection
if the peer claim to be using an incompatible protocol, when they are
exchanging banners.
Signed-off-by: Kefu Chai <kchai@redhat.com>
auto a_while = std::chrono::duration_cast<seastar::steady_clock_type::duration>(
retry_interval);
return seastar::sleep(a_while).then([this] {
- auto peer = [&] {
- auto& mgr_addrs = mgrmap.get_active_addrs();
- if (msgr.get_myaddr().is_legacy()) {
- return mgr_addrs.legacy_addr();
- } else {
- return mgr_addrs.msgr2_addr();
- }
- }();
+ auto peer = mgrmap.get_active_addrs().pick_addr(msgr.get_myaddr().get_type());
if (peer == entity_addr_t{}) {
// crimson msgr only uses the first bound addr
logger().error("mgr.{} does not have an addr compatible with me",
pending_conns.reserve(mons.size());
return seastar::parallel_for_each(mons, [this](auto rank) {
#warning fixme
- auto peer = [&] {
- auto& mon_addrs = monmap.get_addrs(rank);
- if (msgr.get_myaddr().is_legacy()) {
- return mon_addrs.legacy_addr();
- } else {
- return mon_addrs.msgr2_addr();
- }
- }();
+ auto peer = monmap.get_addrs(rank).pick_addr(msgr.get_myaddr().get_type());
if (peer == entity_addr_t{}) {
// crimson msgr only uses the first bound addr
logger().warn("mon.{} does not have an addr compatible with me", rank);