From c64c4e85737186925760a76790258dfb2493b744 Mon Sep 17 00:00:00 2001 From: haoyixing Date: Wed, 31 Mar 2021 06:23:14 +0000 Subject: [PATCH] osd: allow osd_client_message_size throttle set to zero Once we set osd_client_message_size_cap to non-zero, it cannot be set back to zero unless we set conf file to 0 and restart the osd. If we don't want to limit messages by throttle anymore, we have to set a great number as upper bound. So allow it change to 0. Signed-off-by: haoyixing --- src/osd/OSD.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 99e9a863e44c..28ea895d2510 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -10048,14 +10048,14 @@ void OSD::handle_conf_change(const ConfigProxy& conf, if (changed.count("osd_client_message_cap")) { uint64_t newval = cct->_conf->osd_client_message_cap; Messenger::Policy pol = client_messenger->get_policy(entity_name_t::TYPE_CLIENT); - if (pol.throttler_messages && newval > 0) { + if (pol.throttler_messages) { pol.throttler_messages->reset_max(newval); } } if (changed.count("osd_client_message_size_cap")) { uint64_t newval = cct->_conf->osd_client_message_size_cap; Messenger::Policy pol = client_messenger->get_policy(entity_name_t::TYPE_CLIENT); - if (pol.throttler_bytes && newval > 0) { + if (pol.throttler_bytes) { pol.throttler_bytes->reset_max(newval); } } -- 2.47.3