]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: add osd_map_message_max_bytes
authorSage Weil <sage@redhat.com>
Fri, 8 Feb 2019 13:22:20 +0000 (07:22 -0600)
committerKefu Chai <kchai@redhat.com>
Wed, 19 Jun 2019 03:47:34 +0000 (11:47 +0800)
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.

src/common/legacy_config_opts.h
src/common/options.cc

index 7dac8782d2349583321529586894591a896719c5..3f997a41ea452ff4f5915f54127088d6439964fb 100644 (file)
@@ -649,6 +649,7 @@ OPTION(osd_map_dedup, OPT_BOOL)
 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)
index fdbc23312aeee539d396bf27647722cd211a1938..1a1afb6aac44754d03893a998597af1dc16f43e6 100644 (file)
@@ -1928,7 +1928,11 @@ std::vector<Option> get_global_options() {
 
     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)