]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: make live changes for BlueStore throttle config work like initial config
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 29 Mar 2017 13:32:49 +0000 (09:32 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Wed, 29 Mar 2017 13:32:49 +0000 (09:32 -0400)
Make live changes of configuration options bluestore_max_ops,
bluestore_max_bytes, bluestore_deferred_max_ops,
bluestore_deferred_max_bytes work the same way as initial
configuration. Specifically, the deferred throttles have a max to be
the sum of the deferred value and the non-deferred value during
initial configuration, so live changes now work this way.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/os/bluestore/BlueStore.cc

index 3c78e4a0c5fc263c37fe6de61d9ff15f9450739f..67632d2f57bfc0a6c5f9c989708a453fb6c51a86 100644 (file)
@@ -3325,15 +3325,21 @@ void BlueStore::handle_conf_change(const struct md_config_t *conf,
   }
   if (changed.count("bluestore_max_ops")) {
     throttle_ops.reset_max(conf->bluestore_max_ops);
+    throttle_deferred_ops.reset_max(
+      conf->bluestore_max_ops + conf->bluestore_deferred_max_ops);
   }
   if (changed.count("bluestore_max_bytes")) {
     throttle_bytes.reset_max(conf->bluestore_max_bytes);
+    throttle_deferred_bytes.reset_max(
+      conf->bluestore_max_bytes + conf->bluestore_deferred_max_bytes);
   }
   if (changed.count("bluestore_deferred_max_ops")) {
-    throttle_deferred_ops.reset_max(conf->bluestore_deferred_max_ops);
+    throttle_deferred_ops.reset_max(
+      conf->bluestore_max_ops + conf->bluestore_deferred_max_ops);
   }
   if (changed.count("bluestore_deferred_max_bytes")) {
-    throttle_deferred_bytes.reset_max(conf->bluestore_deferred_max_bytes);
+    throttle_deferred_bytes.reset_max(
+      conf->bluestore_max_bytes + conf->bluestore_deferred_max_bytes);
   }
 }