]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: limit size of MOSDMap message sent as reply
authorSage Weil <sage.weil@dreamhost.com>
Fri, 27 Apr 2012 04:29:53 +0000 (21:29 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 28 Apr 2012 14:45:29 +0000 (07:45 -0700)
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 <sage.weil@dreamhost.com>
src/mon/OSDMonitor.cc

index 0cbdcf90580abe527c5837aa75370fa0f0797adf..60422732835fb5ea5b0840a7c66bb0bd6be5d749 100644 (file)
@@ -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);