1
0
mirror of https://github.com/ceph/ceph synced 2025-04-01 14:51:13 +00:00

osd: don't send dup subscribes so much

The subscribe MonClient service is stateful--we don't need to
force a new subscribe send unless sub_want() says we need to.

Keep forcing it for instances where we request an *old* map.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2015-09-28 17:22:01 -04:00
parent d4f813b375
commit 21ca0b591a

View File

@ -3941,7 +3941,7 @@ void OSD::heartbeat()
if (now - last_mon_heartbeat > cct->_conf->osd_mon_heartbeat_interval && is_active()) {
last_mon_heartbeat = now;
dout(10) << "i have no heartbeat peers; checking mon for new map" << dendl;
osdmap_subscribe(osdmap->get_epoch() + 1, true);
osdmap_subscribe(osdmap->get_epoch() + 1, false);
}
}
@ -4538,7 +4538,7 @@ void OSD::_preboot(epoch_t oldest, epoch_t newest)
// get all the latest maps
if (osdmap->get_epoch() + 1 >= oldest)
osdmap_subscribe(osdmap->get_epoch() + 1, true);
osdmap_subscribe(osdmap->get_epoch() + 1, false);
else
osdmap_subscribe(oldest - 1, true);
}
@ -6211,7 +6211,7 @@ void OSD::wait_for_new_map(OpRequestRef op)
{
// ask?
if (waiting_for_osdmap.empty()) {
osdmap_subscribe(osdmap->get_epoch() + 1, true);
osdmap_subscribe(osdmap->get_epoch() + 1, false);
}
logger->inc(l_osd_waiting_for_map);
@ -6330,7 +6330,7 @@ void OSD::handle_osd_map(MOSDMap *m)
dout(10) << "handle_osd_map message skips epochs " << osdmap->get_epoch() + 1
<< ".." << (first-1) << dendl;
if (m->oldest_map <= osdmap->get_epoch() + 1) {
osdmap_subscribe(osdmap->get_epoch()+1, true);
osdmap_subscribe(osdmap->get_epoch()+1, false);
m->put();
return;
}
@ -6616,7 +6616,7 @@ void OSD::handle_osd_map(MOSDMap *m)
if (m->newest_map && m->newest_map > last) {
dout(10) << " msg say newest map is " << m->newest_map << ", requesting more" << dendl;
osdmap_subscribe(osdmap->get_epoch()+1, true);
osdmap_subscribe(osdmap->get_epoch()+1, false);
}
else if (is_preboot()) {
if (m->get_source().is_mon())
@ -6917,7 +6917,7 @@ void OSD::activate_map()
if (osdmap->test_flag(CEPH_OSDMAP_FULL)) {
dout(10) << " osdmap flagged full, doing onetime osdmap subscribe" << dendl;
osdmap_subscribe(osdmap->get_epoch() + 1, true);
osdmap_subscribe(osdmap->get_epoch() + 1, false);
}
// norecover?