From 9087e3b751a78211011b39377394ceb297078f76 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Fri, 24 Jan 2020 19:36:56 -0500 Subject: [PATCH] Revert "ceph_osd: remove client message cap limit" This reverts commit 45d5ac3ea040d6a7213b63d1c582e3a1bbaae8d4. 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 Signed-off-by: Neha Ojha --- src/ceph_osd.cc | 6 +++++- src/common/options.cc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index 3e03e8632396e..e0f006593480a 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -567,6 +567,9 @@ flushjournal_out: g_conf().get_val("osd_client_message_size_cap"); boost::scoped_ptr client_byte_throttler( new Throttle(g_ceph_context, "osd_client_bytes", message_size)); + uint64_t message_cap = g_conf().get_val("osd_client_message_cap"); + boost::scoped_ptr 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 = @@ -577,7 +580,7 @@ flushjournal_out: 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, @@ -750,6 +753,7 @@ flushjournal_out: 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]; diff --git a/src/common/options.cc b/src/common/options.cc index d7b1792590cb8..c4c606127889d 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -2506,7 +2506,7 @@ std::vector