]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix beacon condition
authorSage Weil <sage@redhat.com>
Fri, 31 Mar 2017 19:22:00 +0000 (15:22 -0400)
committerSage Weil <sage@redhat.com>
Fri, 31 Mar 2017 19:22:00 +0000 (15:22 -0400)
- && 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 <sage@redhat.com>
src/osd/OSD.cc

index 4e3afa6e17415f2d1b99efa90c263757f41d8240..b476f4aaeaf271202a68d948019fe43870c2f0b0 100644 (file)
@@ -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;
   }
 }