mirror of
https://github.com/ceph/ceph
synced 2025-02-21 09:57:26 +00:00
mon: add clock sync backoff to handle_lease_ack
This commit is contained in:
parent
6998372a8f
commit
c4ab621ed6
@ -574,9 +574,8 @@ void Paxos::handle_lease(MMonPaxos *lease)
|
||||
allowed_time.set_from_double(g_clock.now() + g_conf.mon_clock_drift_allowed);
|
||||
if (lease->sent_timestamp > allowed_time) {
|
||||
utime_t warn_diff = g_clock.now() - last_clock_drift_warn;
|
||||
if ((last_clock_drift_warn == utime_t()) ||
|
||||
(warn_diff >
|
||||
pow(g_conf.mon_clock_drift_warn_backoff, clock_drift_warned))) {
|
||||
if (warn_diff >
|
||||
pow(g_conf.mon_clock_drift_warn_backoff, clock_drift_warned)) {
|
||||
stringstream ss;
|
||||
ss << "lease_expire from mon" << lease->get_source().num()
|
||||
<< " was sent from future time " << lease->sent_timestamp
|
||||
@ -653,12 +652,18 @@ void Paxos::handle_lease_ack(MMonPaxos *ack)
|
||||
utime_t allowed_time;
|
||||
allowed_time.set_from_double(g_clock.now() + g_conf.mon_clock_drift_allowed);
|
||||
if (ack->sent_timestamp > allowed_time) {
|
||||
stringstream ss;
|
||||
ss << "lease_ack from mon" << from
|
||||
<< " was sent from future time " << ack->sent_timestamp
|
||||
<< " with allowed time <=" << allowed_time
|
||||
<< ", clocks not synchronized." << std::endl;
|
||||
mon->get_logclient()->log(LOG_WARN, ss);
|
||||
utime_t warn_diff = g_clock.now() - last_clock_drift_warn;
|
||||
if (warn_diff >
|
||||
pow(g_conf.mon_clock_drift_warn_backoff, clock_drift_warned)) {
|
||||
stringstream ss;
|
||||
ss << "lease_ack from mon" << from
|
||||
<< " was sent from future time " << ack->sent_timestamp
|
||||
<< " with allowed time <=" << allowed_time
|
||||
<< ", clocks not synchronized." << std::endl;
|
||||
mon->get_logclient()->log(LOG_WARN, ss);
|
||||
last_clock_drift_warn = g_clock.now();
|
||||
++clock_drift_warned;
|
||||
}
|
||||
}
|
||||
ack->put();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user