From: Sage Weil Date: Fri, 21 Oct 2016 15:25:38 +0000 (-0400) Subject: os/bluestore: randomly inject serialize transaction submission X-Git-Tag: v11.1.0~456^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=24eb39055d5abf7e2a2c4b5da4d793aa7c5ae15d;p=ceph.git os/bluestore: randomly inject serialize transaction submission Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index d3ea410cb8cc..4f1a588bc39a 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 4ce7927c0822..ca54224049e3 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 973923c0f3e1..d176a565549b 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");