* Foundation. See file COPYING.
*/
+#ifndef CEPH_MGRMONITOR_H
+#define CEPH_MGRMONITOR_H
#include "include/Context.h"
#include "MgrMap.h"
#include "PaxosService.h"
-
-class MgrMonitor : public PaxosService
+class MgrMonitor: public PaxosService
{
MgrMap map;
MgrMap pending_map;
+ bool ever_had_active_mgr = false;
utime_t first_seen_inactive;
- std::map<uint64_t, utime_t> last_beacon;
+ std::map<uint64_t, ceph::coarse_mono_clock::time_point> last_beacon;
/**
* If a standby is available, make it active, given that
void drop_active();
void drop_standby(uint64_t gid);
- Context *digest_callback;
+ Context *digest_event = nullptr;
+ void cancel_timer();
bool check_caps(MonOpRequestRef op, const uuid_d& fsid);
+ health_status_t should_warn_about_mgr_down();
+
public:
MgrMonitor(Monitor *mn, Paxos *p, const string& service_name)
- : PaxosService(mn, p, service_name), digest_callback(nullptr)
+ : PaxosService(mn, p, service_name)
{}
+ ~MgrMonitor() override {}
void init() override;
void on_shutdown() override;
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;
friend class C_Updated;
};
+#endif