From 6f2f8b3e3b8252437bc7ddcc820de2d9bbafb8f8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 6 Mar 2017 13:50:30 -0500 Subject: [PATCH] os/bluestore: pin writing cache buffers until txc is finished Notably, this includes WAL writes, which means an in-flight WAL write will always be in the cache. Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index c0821f969d4..7a7dde46a8a 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7124,10 +7124,6 @@ void BlueStore::_txc_state_proc(TransContext *txc) } txc->log_state_latency(logger, l_bluestore_state_io_done_lat); txc->state = TransContext::STATE_KV_QUEUED; - for (auto& sb : txc->shared_blobs_written) { - sb->bc.finish_write(sb->get_cache(), txc->seq); - } - txc->shared_blobs_written.clear(); if (cct->_conf->bluestore_sync_submit_transaction && fm->supports_parallel_transactions()) { if (txc->last_nid >= nid_max || @@ -7384,6 +7380,11 @@ void BlueStore::_txc_finish(TransContext *txc) dout(20) << __func__ << " " << txc << " onodes " << txc->onodes << dendl; assert(txc->state == TransContext::STATE_FINISHING); + for (auto& sb : txc->shared_blobs_written) { + sb->bc.finish_write(sb->get_cache(), txc->seq); + } + txc->shared_blobs_written.clear(); + for (auto ls : { &txc->onodes, &txc->modified_objects }) { for (auto& o : *ls) { std::lock_guard l(o->flush_lock); -- 2.47.3