default: 1_min
services:
- mon
+- name: mon_down_uptime_grace
+ type: secs
+ level: advanced
+ desc: Period in seconds that the cluster may have a mon down after this (leader) monitor comes up.
+ default: 1_min
+ services:
+ - mon
+ flags:
+ - runtime
- name: mon_mgr_beacon_grace
type: secs
level: advanced
{
int max = mon.monmap->size();
int actual = mon.get_quorum().size();
- const auto now = ceph::real_clock::now();
+ const auto rcnow = ceph::real_clock::now();
+ const auto created = mon.monmap->created.to_real_time();
+ const auto mcnow = ceph::coarse_mono_clock::now();
+ const auto starttime = mon.get_starttime();
+
if (actual < max &&
- now > mon.monmap->created.to_real_time() + g_conf().get_val<std::chrono::seconds>("mon_down_mkfs_grace")) {
+ (rcnow - created) > g_conf().get_val<std::chrono::seconds>("mon_down_mkfs_grace") &&
+ (mcnow - starttime) > g_conf().get_val<std::chrono::seconds>("mon_down_uptime_grace")) {
ostringstream ss;
ss << (max-actual) << "/" << max << " mons down, quorum "
<< mon.get_quorum_names();
f->dump_int("rank", rank);
f->dump_string("state", get_state_name());
f->dump_int("election_epoch", get_epoch());
+ f->dump_int("uptime", get_uptime().count());
f->open_array_section("quorum");
for (set<int>::iterator p = quorum.begin(); p != quorum.end(); ++p) {
}
bool is_keyring_required();
+
+public:
+ ceph::coarse_mono_time get_starttime() const {
+ return starttime;
+ }
+ std::chrono::milliseconds get_uptime() const {
+ auto now = ceph::coarse_mono_clock::now();
+ return std::chrono::duration_cast<std::chrono::milliseconds>(now-starttime);
+ }
+
+private:
+ ceph::coarse_mono_time const starttime = coarse_mono_clock::now();
};
#define CEPH_MON_FEATURE_INCOMPAT_BASE CompatSet::Feature (1, "initial feature set (~v.18)")