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
- this file does not exist in mimic; apply change to src/common/config.h instead
- size_t -> uint64_t
#define OPTION_OPT_U32(name) uint64_t name;
#define OPTION_OPT_U64(name) uint64_t name;
#define OPTION_OPT_UUID(name) uuid_d name;
+#define OPTION_OPT_SIZE(name) uint64_t name;
#define OPTION(name, ty) \
public: \
OPTION_##ty(name)
OPTION(osd_map_dedup, OPT_BOOL)
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_SIZE) // 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_SIZE, 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)