From e15be00560c1492e0807d0779cfd0d6088396b3e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 8 Feb 2019 07:22:20 -0600 Subject: [PATCH] common/options: add osd_map_message_max_bytes Limit MOSDMap message size by bytes as well as map count. Signed-off-by: Sage Weil --- src/common/config_values.h | 1 + src/common/legacy_config_opts.h | 1 + src/common/options.cc | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/config_values.h b/src/common/config_values.h index 2614d2ef159..fdfff2b16f3 100644 --- a/src/common/config_values.h +++ b/src/common/config_values.h @@ -49,6 +49,7 @@ public: #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) size_t name; #define OPTION(name, ty) \ public: \ OPTION_##ty(name) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 0269656f8fa..247207e447e 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -599,6 +599,7 @@ OPTION(osd_objecter_finishers, OPT_INT) 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) diff --git a/src/common/options.cc b/src/common/options.cc index e11ce93674d..6737ff0dac8 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -2578,7 +2578,11 @@ std::vector