do_propose |= maybe_expand_cluster(i.second);
}
+ const auto now = ceph_clock_now(g_ceph_context);
+ if (last_tick.is_zero()) {
+ last_tick = now;
+ }
+
+ if (now - last_tick > (g_conf->mds_beacon_grace - g_conf->mds_beacon_interval)) {
+ // This case handles either local slowness (calls being delayed
+ // for whatever reason) or cluster election slowness (a long gap
+ // between calls while an election happened)
+ dout(4) << __func__ << ": resetting beacon timeouts due to mon delay "
+ "(slow election?) of " << now - last_tick << " seconds" << dendl;
+ for (auto &i : last_beacon) {
+ i.second.stamp = now;
+ }
+ }
+
+ last_tick = now;
+
// check beacon timestamps
- utime_t now = ceph_clock_now(g_ceph_context);
utime_t cutoff = now;
cutoff -= g_conf->mds_beacon_grace;
for (const auto &p : pending_fsmap.mds_roles) {
auto &gid = p.first;
if (last_beacon.count(gid) == 0) {
- last_beacon[gid].stamp = ceph_clock_now(g_ceph_context);
+ last_beacon[gid].stamp = now;
last_beacon[gid].seq = 0;
}
}
"mds rm_data_pool"));
}
+void MDSMonitor::on_restart()
+{
+ // Clear out the leader-specific state.
+ last_tick = utime_t();
+ last_beacon.clear();
+}
+
bool should_propose(double& delay);
void on_active();
+ void on_restart();
void check_subs();
void check_sub(Subscription *sub);
int _check_pool(const int64_t pool_id, std::stringstream *ss) const;
mds_gid_t gid_from_arg(const std::string& arg, std::ostream& err);
+
+ // When did the mon last call into our tick() method? Used for detecting
+ // when the mon was not updating us for some period (e.g. during slow
+ // election) to reset last_beacon timeouts
+ utime_t last_tick;
};
#endif