]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: allow client throttler to be adjusted on-fly, without restart 13216/head
authorPiotr Dałek <piotr.dalek@corp.ovh.com>
Tue, 31 Jan 2017 15:07:18 +0000 (16:07 +0100)
committerPiotr Dałek <piotr.dalek@corp.ovh.com>
Thu, 2 Feb 2017 08:43:24 +0000 (09:43 +0100)
This patch allows the osd_client_message_cap and
osd_client_message_size_cap to be adjusted on-fly, using admin socket
functionality.

Fixes: http://tracker.ceph.com/issues/18791
Signed-off-by: Piotr Dałek <piotr.dalek@corp.ovh.com>
(cherry picked from commit 64c309d7e18a975931b526e6f5d6f610c3a0d632)

src/osd/OSD.cc

index 3b62ef3755b80c74bb6ef8c8ca82a6622424ea68..04819d8b77c0f9eb78fb0aa35d2101e5a84d2e36 100644 (file)
@@ -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;
@@ -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();
 }