Skip to content

Commit

Permalink
Merge pull request #13213 from ovh/bp-osd-updateable-throttles
Browse files Browse the repository at this point in the history
osd: allow client throttler to be adjusted on-fly, without restart

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
yuriw committed Feb 3, 2017
2 parents dd859f4 + 64c309d commit f5b676a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/osd/OSD.cc
Expand Up @@ -9176,6 +9176,8 @@ const char** OSD::get_tracked_conf_keys() const
"host",
"fsid",
"osd_recovery_delay_start",
"osd_client_message_size_cap",
"osd_client_message_cap",
NULL
};
return KEYS;
Expand Down Expand Up @@ -9239,6 +9241,21 @@ void OSD::handle_conf_change(const struct md_config_t *conf,
service.kick_recovery_queue();
}

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) {
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) {
pol.throttler_bytes->reset_max(newval);
}
}

check_config();
}

Expand Down

0 comments on commit f5b676a

Please sign in to comment.