From: Sage Weil Date: Mon, 28 Sep 2015 21:22:01 +0000 (-0400) Subject: osd: don't send dup subscribes so much X-Git-Tag: v10.0.1~26^2~42 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=21ca0b591aa495586f771b11a2ad2f5d9b920dfb;p=ceph.git 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 0d892e698273..14989e207e97 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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?