From: Sage Weil Date: Fri, 27 Apr 2012 04:29:53 +0000 (-0700) Subject: mon: limit size of MOSDMap message sent as reply X-Git-Tag: v0.47~90^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e44b126c409d2bdbd2896dc2338e4b9eb06a6ac2;p=ceph.git mon: limit size of MOSDMap message sent as reply We may send an MOSDMap as a reply to various requests, including - a failure report - a boot message - a pg_temp message - an up_thru message In these cases, send a single MOSDMap message, but limit how big it gets. All recipients here are osds, which are smart enough to request more maps based on the MOSDMap::newest_map field. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 0cbdcf90580a..60422732835f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -990,7 +990,11 @@ void OSDMonitor::send_incremental(PaxosServiceMessage *req, epoch_t first) mon->send_reply(req, m); return; } - MOSDMap *m = build_incremental(first, osdmap.get_epoch()); + + // send some maps. it may not be all of them, but it will get them + // started. + epoch_t last = MIN(first + g_conf->osd_map_message_max, osdmap.get_epoch()); + MOSDMap *m = build_incremental(first, last); m->oldest_map = paxos->get_first_committed(); m->newest_map = osdmap.get_epoch(); mon->send_reply(req, m);