]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: allow client throttler to be adjusted on-fly, without restart 13214/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:41:21 +0000 (09:41 +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)

Conflicts:
src/osd/OSD.cc (suppressed post-jewel option)

src/osd/OSD.cc

index a5c92fb4811366aa2af31d547a646e5785988a9d..a9e3753426014cd9198791cac1b0fd414b464069 100644 (file)
@@ -8940,6 +8940,8 @@ const char** OSD::get_tracked_conf_keys() const
     "clog_to_graylog_port",
     "host",
     "fsid",
+    "osd_client_message_size_cap",
+    "osd_client_message_cap",
     NULL
   };
   return KEYS;
@@ -8996,6 +8998,22 @@ void OSD::handle_conf_change(const struct md_config_t *conf,
     }
   }
 #endif
+
+  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();
 }