double wait = .5 + ((float)(rand() % 10)/10.0) * (float)g_conf.osd_heartbeat_interval;
utime_t w;
w.set_from_double(wait);
+ dout(30) << "heartbeat_entry sleeping for " << wait << dendl;
heartbeat_cond.WaitInterval(heartbeat_lock, w);
+ dout(30) << "heartbeat_entry woke up" << dendl;
}
heartbeat_lock.Unlock();
}
{
utime_t now = g_clock.now();
+ dout(30) << "heartbeat" << dendl;
+
if (got_sigterm) {
derr << "got SIGTERM, shutting down" << dendl;
Message *m = new MGenericMessage(CEPH_MSG_SHUTDOWN);
derr << "heartbeat: failed to read /proc/loadavg" << dendl;
}
+ dout(30) << "heartbeat checking stats" << dendl;
+
// calc my stats
Mutex::Locker lock(peer_stat_lock);
_refresh_my_stat(now);
//load_calc.set_size(stat_ops);
bool map_locked = map_lock.try_get_read();
-
+ dout(30) << "heartbeat map_locked=" << map_locked << dendl;
+
// send heartbeats
for (map<int, epoch_t>::iterator i = heartbeat_to.begin();
i != heartbeat_to.end();
int peer = i->first;
if (heartbeat_inst.count(peer)) {
my_stat_on_peer[peer] = my_stat;
+ dout(30) << "heartbeat allocating ping for osd" << peer << dendl;
Message *m = new MOSDPing(osdmap->get_fsid(),
map_locked ? osdmap->get_epoch():0,
i->second,
my_stat);
m->set_priority(CEPH_MSG_PRIO_HIGH);
+ dout(30) << "heartbeat sending ping to osd" << peer << dendl;
heartbeat_messenger->send_message(m, heartbeat_inst[peer]);
}
}
- if (map_locked)
+ if (map_locked) {
+ dout(30) << "heartbeat check" << dendl;
heartbeat_check();
+ } else {
+ dout(30) << "heartbeat no map_lock, no check" << dendl;
+ }
if (logger) logger->set(l_osd_hbto, heartbeat_to.size());
if (logger) logger->set(l_osd_hbfrom, heartbeat_from.size());
// hmm.. am i all alone?
+ dout(30) << "heartbeat lonely?" << dendl;
if (heartbeat_from.empty() || heartbeat_to.empty()) {
if (now - last_mon_heartbeat > g_conf.osd_mon_heartbeat_interval) {
last_mon_heartbeat = now;
}
}
- if (map_locked)
+ if (map_locked) {
+ dout(30) << "heartbeat put map_lock" << dendl;
map_lock.put_read();
+ }
+ dout(30) << "heartbeat done" << dendl;
}