Wait at least one beacon interval between mon session resets.
Fixes: #9428
Signed-off-by: Sage Weil <sage@redhat.com>
dout(5) << "is_laggy " << since << " > " << g_conf->mds_beacon_grace
<< " since last acked beacon" << dendl;
was_laggy = true;
- if (since > (g_conf->mds_beacon_grace*2)) {
+ if (since > (g_conf->mds_beacon_grace*2) &&
+ now > last_mon_reconnect + g_conf->mds_beacon_interval) {
// maybe it's not us?
dout(5) << "initiating monitor reconnect; maybe we're not the slow one"
<< dendl;
+ last_mon_reconnect = now;
monc->reopen_session();
}
return true;
version_t last_seq; // last seq sent to monitor
std::map<version_t,utime_t> seq_stamp; // seq # -> time sent
utime_t last_acked_stamp; // last time we sent a beacon that got acked
+ utime_t last_mon_reconnect;
bool was_laggy;
utime_t laggy_until;