Skip to content

Commit

Permalink
Revert "ceph_osd: remove client message cap limit"
Browse files Browse the repository at this point in the history
This reverts commit 45d5ac3.

Without a msg throttler, we can't change osd_client_message_cap cap.
The throttler is designed to work with 0 as a max, so change the
default to 0 to disable it by default instead.

This doesn't affect the default behavior, it only lets us use this
option again.

Fixes: https://tracker.ceph.com/issues/46143

Conflicts:
	src/ceph_osd.cc - new style of gconf() access

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
Signed-off-by: Neha Ojha <nojha@redhat.com>
  • Loading branch information
jdurgin committed Jun 22, 2020
1 parent 5eef6e6 commit 9087e3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/ceph_osd.cc
Expand Up @@ -567,6 +567,9 @@ int main(int argc, const char **argv)
g_conf().get_val<Option::size_t>("osd_client_message_size_cap");
boost::scoped_ptr<Throttle> client_byte_throttler(
new Throttle(g_ceph_context, "osd_client_bytes", message_size));
uint64_t message_cap = g_conf().get_val<uint64_t>("osd_client_message_cap");
boost::scoped_ptr<Throttle> client_msg_throttler(
new Throttle(g_ceph_context, "osd_client_messages", message_cap));

// All feature bits 0 - 34 should be present from dumpling v0.67 forward
uint64_t osd_required =
Expand All @@ -577,7 +580,7 @@ int main(int argc, const char **argv)
ms_public->set_default_policy(Messenger::Policy::stateless_server(0));
ms_public->set_policy_throttlers(entity_name_t::TYPE_CLIENT,
client_byte_throttler.get(),
nullptr);
client_msg_throttler.get());
ms_public->set_policy(entity_name_t::TYPE_MON,
Messenger::Policy::lossy_client(osd_required));
ms_public->set_policy(entity_name_t::TYPE_MGR,
Expand Down Expand Up @@ -750,6 +753,7 @@ int main(int argc, const char **argv)
delete ms_objecter;

client_byte_throttler.reset();
client_msg_throttler.reset();

// cd on exit, so that gmon.out (if any) goes into a separate directory for each node.
char s[20];
Expand Down
2 changes: 1 addition & 1 deletion src/common/options.cc
Expand Up @@ -2506,7 +2506,7 @@ std::vector<Option> get_global_options() {
.set_long_description("If this value is exceeded, the OSD will not read any new client data off of the network until memory is freed."),

Option("osd_client_message_cap", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(100)
.set_default(0)
.set_description("maximum number of in-flight client requests"),

Option("osd_crush_update_weight_set", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
Expand Down

0 comments on commit 9087e3b

Please sign in to comment.