summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage.weil@dreamhost.com>2012-04-26 21:29:53 -0700
committerSage Weil <sage.weil@dreamhost.com>2012-04-28 07:45:29 -0700
commite44b126c409d2bdbd2896dc2338e4b9eb06a6ac2 (patch)
tree05f8481710c536322a21901fd08fc8bb8eabdd9a
parentd1df320b2d55c93b8e4230861b3debc12b9b717f (diff)
downloadceph-e44b126c409d2bdbd2896dc2338e4b9eb06a6ac2.tar.gz
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 <sage.weil@dreamhost.com>
-rw-r--r--src/mon/OSDMonitor.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 0cbdcf90580..60422732835 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);