Limit MOSDMap message size by bytes as well as map count.
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit
e15be00560c1492e0807d0779cfd0d6088396b3e)
Conflicts:
src/common/config_values.h: the changes in this file is applied
to src/common/config.h instead. because, src/common/config_values.h
is extracted in
4718b7cb2fac65b2ac7014f42ba1a10181350f0b. which
happened after luminous, and that commit was not backported.
also, the OPT_SIZE is changed to OPT_U64, as we don't have OPT_SIZE by
then, the size_t option support was added after luminous, and that
change was not backported. so let's use the uint64_t as an alternative,
as other *bytes settings are also using OPT_U64. and OSDMonitor.cc
will be accessing that setting using the legacy way instead of using
conf.get_val<>() interface, so this change will have no impact on the
fix.
OPTION(osd_map_max_advance, OPT_INT) // make this < cache_size!
OPTION(osd_map_cache_size, OPT_INT)
OPTION(osd_map_message_max, OPT_INT) // max maps per MOSDMap message
+OPTION(osd_map_message_max_bytes, OPT_U64) // max maps per MOSDMap message
OPTION(osd_map_share_max_epochs, OPT_INT) // cap on # of inc maps we send to peers, clients
OPTION(osd_inject_bad_map_crc_probability, OPT_FLOAT)
OPTION(osd_inject_failure_on_pg_removal, OPT_BOOL)
Option("osd_map_message_max", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(40)
- .set_description(""),
+ .set_description("maximum number of OSDMaps to include in a single message"),
+
+ Option("osd_map_message_max_bytes", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+ .set_default(10_M)
+ .set_description("maximum number of bytes worth of OSDMaps to include in a single message"),
Option("osd_map_share_max_epochs", Option::TYPE_INT, Option::LEVEL_ADVANCED)
.set_default(40)