From 87be6b0069735dd1a1f6f3bda756564d10538da1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 21 Mar 2016 13:51:43 -0400 Subject: [PATCH] os/bluestore: bluestore_inject_wal_apply_delay Signed-off-by: Sage Weil --- src/common/config_opts.h | 1 + src/os/bluestore/BlueStore.cc | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index ff14af2f4e1cf..5d1a6e8c8b08c 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -966,6 +966,7 @@ OPTION(bluestore_debug_small_allocations, OPT_INT, 0) OPTION(bluestore_debug_freelist, OPT_BOOL, false) OPTION(bluestore_debug_prefill, OPT_FLOAT, 0) OPTION(bluestore_debug_prefragment_max, OPT_INT, 1048576) +OPTION(bluestore_inject_wal_apply_delay, OPT_FLOAT, 0) OPTION(kstore_max_ops, OPT_U64, 512) OPTION(kstore_max_bytes, OPT_U64, 64*1024*1024) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index afe1e9b1abd04..c89cb43339f84 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3991,6 +3991,16 @@ int BlueStore::_wal_apply(TransContext *txc) txc->log_state_latency(logger, l_bluestore_state_wal_queued_lat); txc->state = TransContext::STATE_WAL_APPLYING; + if (g_conf->bluestore_inject_wal_apply_delay) { + dout(20) << __func__ << " bluestore_inject_wal_apply_delay " + << g_conf->bluestore_inject_wal_apply_delay + << dendl; + utime_t t; + t.set_from_double(g_conf->bluestore_inject_wal_apply_delay); + t.sleep(); + dout(20) << __func__ << " finished sleep" << dendl; + } + assert(txc->ioc.pending_aios.empty()); vector::iterator q = txc->wal_op_onodes.begin(); for (list::iterator p = wt.ops.begin(); -- 2.39.5