]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: New configuration option osd_delete_sleep 24501/head
authorDavid Zafman <dzafman@redhat.com>
Tue, 9 Oct 2018 20:24:38 +0000 (13:24 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 13 Nov 2018 20:18:31 +0000 (12:18 -0800)
Causes the remove_wq thread to sleep the specified number
of seconds between transactions.

Fixes: http://tracker.ceph.com/issues/36321
Signed-off-by: David Zafman <dzafman@redhat.com>
This backport is not cherry-picked from master since the remove
threadpool was folded into the main op queue post-luminous, so the
code is almost entirely different.

src/common/legacy_config_opts.h
src/common/options.cc
src/osd/OSD.cc

index 8232fdc3d788eb92fea4ea6c2fac40b28344cb89..25780b32b3eca417867138ced07970dccb8137ee 100644 (file)
@@ -848,6 +848,7 @@ OPTION(osd_op_history_duration, OPT_U32) // Oldest completed op to track
 OPTION(osd_op_history_slow_op_size, OPT_U32)           // Max number of slow ops to track
 OPTION(osd_op_history_slow_op_threshold, OPT_DOUBLE) // track the op if over this threshold
 OPTION(osd_target_transaction_size, OPT_INT)     // to adjust various transactions that batch smaller items
+OPTION(osd_delete_sleep, OPT_FLOAT)         // seconds to sleep between removal transactions
 OPTION(osd_failsafe_full_ratio, OPT_FLOAT) // what % full makes an OSD "full" (failsafe)
 OPTION(osd_fast_fail_on_connection_refused, OPT_BOOL) // immediately mark OSDs as down once they refuse to accept connections
 
index 970a12f3fe6144874819e5150cf49d3d144a02f7..966cd1a4a180e0be465fc6efaf79513e0a497ef5 100644 (file)
@@ -2846,6 +2846,10 @@ std::vector<Option> get_global_options() {
     .set_default(30)
     .set_description(""),
 
+    Option("osd_delete_sleep", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
+    .set_default(0)
+    .set_description("Time in seconds to sleep before next removal transaction"),
+
     Option("osd_failsafe_full_ratio", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
     .set_default(.97)
     .set_description(""),
index 75063ef84ae4460a50a6d3b190eb7befda8f3921..40249005e3e5a9c10a3efeaa79bceb4642d5da43 100644 (file)
@@ -5702,6 +5702,12 @@ bool remove_dir(
       cont = dstate->pause_clearing();
       handle.suspend_tp_timeout();
       waiter.wait();
+      if (cct->_conf->osd_delete_sleep) {
+        utime_t t;
+        t.set_from_double(cct->_conf->osd_delete_sleep);
+        lgeneric_subdout(cct, osd, 10) << __func__ << " inject delay of " << t << dendl;
+        t.sleep();
+      }
       handle.reset_tp_timeout();
       if (cont)
         cont = dstate->resume_clearing();