From 24eb39055d5abf7e2a2c4b5da4d793aa7c5ae15d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 21 Oct 2016 11:25:38 -0400 Subject: [PATCH] os/bluestore: randomly inject serialize transaction submission Signed-off-by: Sage Weil --- src/common/config_opts.h | 1 + src/os/bluestore/BlueStore.cc | 5 +++++ src/test/objectstore/store_test.cc | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index d3ea410cb8ccd..4f1a588bc39ac 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 4ce7927c08221..ca54224049e3b 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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; diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 973923c0f3e1c..d176a565549b4 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -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"); -- 2.39.5