]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: allow client throttler to be adjusted on-fly, without restart 13213/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:32:55 +0000 (09:32 +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>
src/osd/OSD.cc

index 7afa5dc20055ec50c07b1cc834ea5c5bb791d207..c072edfd57dc99a333bfae160cab46a1e4eb36f9 100644 (file)
@@ -9165,6 +9165,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;
@@ -9228,6 +9230,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();
 }