]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/MgrMonitor: clear last_beacon after mon election
authorSage Weil <sage@redhat.com>
Thu, 6 Jul 2017 21:53:34 +0000 (17:53 -0400)
committerSage Weil <sage@redhat.com>
Wed, 12 Jul 2017 16:52:03 +0000 (12:52 -0400)
The last_beacon map is local to an election interval; if there is a new
election completed we should reset it or else we may kill an apparently
laggy mgr that hasn't been able to get a beacon processed due to the mon
quorum changing, or had its beacon processed on a different leader.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MgrMonitor.cc
src/mon/MgrMonitor.h

index 5420bdee3d9944b36ff54f56d300ccefed63fec6..e1688a39681ef1f08b15ce50da4808be51efb570 100644 (file)
@@ -485,6 +485,13 @@ void MgrMonitor::tick()
   }
 }
 
+void MgrMonitor::on_restart()
+{
+  // Clear out the leader-specific state.
+  last_beacon.clear();
+}
+
+
 bool MgrMonitor::promote_standby()
 {
   assert(pending_map.active_gid == 0);
index ca363ddeef6e857a5b5eb2b1a7bee940019b75bd..0dc1af571deeaaf9dcdf50789a5e9d14d823a307 100644 (file)
@@ -79,6 +79,8 @@ public:
   void send_digests();
 
   void on_active() override;
+  void on_restart() override;
+
   void get_health(list<pair<health_status_t,string> >& summary,
                  list<pair<health_status_t,string> > *detail,
                  CephContext *cct) const override;