From: Sage Weil Date: Fri, 31 Mar 2017 19:22:00 +0000 (-0400) Subject: osd: fix beacon condition X-Git-Tag: v12.0.2~229^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b077463815e23cd98c81a74f8b32f8b42182700;p=ceph.git osd: fix beacon condition - && should have been || - change this to instead not send when monmap epoch==0, and only set last_sent_beacon if we actually send. That way we'll send on the next tick after we get a real monmap. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 4e3afa6e174..b476f4aaeaf 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5560,15 +5560,17 @@ void OSD::flush_pg_stats() void OSD::send_beacon(const ceph::coarse_mono_clock::time_point& now) { - dout(20) << __func__ << dendl; - last_sent_beacon = now; const auto& monmap = monc->monmap; // send beacon to mon even if we are just connected, and the monmap is not // initialized yet by then. - if (monmap.epoch == 0 && + if (monmap.epoch > 0 && monmap.get_required_features().contains_all( ceph::features::mon::FEATURE_LUMINOUS)) { + dout(20) << __func__ << " sending" << dendl; + last_sent_beacon = now; monc->send_mon_message(new MOSDBeacon()); + } else { + dout(20) << __func__ << " not sending" << dendl; } }