]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: randomly inject serialize transaction submission
authorSage Weil <sage@redhat.com>
Fri, 21 Oct 2016 15:25:38 +0000 (11:25 -0400)
committerSage Weil <sage@redhat.com>
Tue, 1 Nov 2016 14:31:27 +0000 (10:31 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/os/bluestore/BlueStore.cc
src/test/objectstore/store_test.cc

index d3ea410cb8ccd744f5a769fb83d62fcb0a26c10c..4f1a588bc39acc91816a698b7fd6b4072c5fae9e 100644 (file)
@@ -1032,6 +1032,7 @@ OPTION(bluestore_debug_freelist, OPT_BOOL, false)
 OPTION(bluestore_debug_prefill, OPT_FLOAT, 0)
 OPTION(bluestore_debug_prefragment_max, OPT_INT, 1048576)
 OPTION(bluestore_debug_inject_read_err, OPT_BOOL, false)
+OPTION(bluestore_debug_randomize_serial_transaction, OPT_INT, 0)
 OPTION(bluestore_inject_wal_apply_delay, OPT_FLOAT, 0)
 OPTION(bluestore_shard_finishers, OPT_BOOL, false)
 
index 4ce7927c082219b7d769cbfc12edcc2ef3e95231..ca54224049e3b217b5d825ceab6bc069f5f24aab 100644 (file)
@@ -6180,6 +6180,11 @@ void BlueStore::_txc_state_proc(TransContext *txc)
          // sequencer that is committing serially it is possible to keep
          // submitting new transactions fast enough that we get stuck doing
          // so.  the alternative is to block here... fixme?
+       } else if (g_conf->bluestore_debug_randomize_serial_transaction &&
+                  rand() % g_conf->bluestore_debug_randomize_serial_transaction
+                  == 0) {
+         dout(20) << __func__ << " DEBUG randomly forcing submit via kv thread"
+                  << dendl;
        } else {
          _txc_finalize_kv(txc, txc->t);
          txc->kv_submitted = true;
index 973923c0f3e1c1821a3034c0f03bb2b2dac2e415..d176a565549b4d55765979c206bcc0ad734e2a96 100644 (file)
@@ -5814,6 +5814,12 @@ int main(int argc, char **argv) {
   g_ceph_context->_conf->set_val("bluestore_buffer_cache_size", "2000000");
   g_ceph_context->_conf->set_val("bluestore_onode_cache_size", "500");
 
+  // very short *_max prealloc so that we fall back to async submits
+  g_ceph_context->_conf->set_val("bluestore_blobid_prealloc", "10");
+  g_ceph_context->_conf->set_val("bluestore_nid_prealloc", "10");
+  g_ceph_context->_conf->set_val("bluestore_debug_randomize_serial_transaction",
+                                "10");
+
   // specify device size
   g_ceph_context->_conf->set_val("bluestore_block_size", "10240000000");