return -ETIMEDOUT;
}
- mgrc.init();
- messenger->add_dispatcher_head(&mgrc);
-
mds_lock.Lock();
if (beacon.get_want_state() == CEPH_MDS_STATE_DNE) {
dout(4) << __func__ << ": terminated already, dropping out" << dendl;
}
monc->sub_want("mdsmap", 0, 0);
- monc->sub_want("mgrmap", 0, 0);
monc->renew_subs();
mds_lock.Unlock();
respawn();
}
+ if (old_state == DS::STATE_NULL && new_state != DS::STATE_NULL) {
+ /* The MDS has been added to the FSMap, now we can init the MgrClient */
+ mgrc.init();
+ messenger->add_dispatcher_tail(&mgrc);
+ monc->sub_want("mgrmap", 0, 0);
+ monc->renew_subs(); /* MgrMap receipt drives connection to ceph-mgr */
+ }
+
// mark down any failed peers
for (const auto& [gid, info] : oldmap->get_mds_info()) {
if (mdsmap->get_mds_info().count(gid) == 0) {
}
beacon.shutdown();
- mgrc.shutdown();
+ if (mgrc.is_initialized())
+ mgrc.shutdown();
if (mds_rank) {
mds_rank->shutdown();
std::map<std::string,std::string> &&task_status);
void update_daemon_health(std::vector<DaemonHealthMetric>&& metrics);
+ bool is_initialized() const { return initialized; }
+
private:
void _send_stats();
void _send_pgstats();
void _send_report();
+
+ bool initialized = false;
};
#endif