]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: pin writing cache buffers until txc is finished
authorSage Weil <sage@redhat.com>
Mon, 6 Mar 2017 18:50:30 +0000 (13:50 -0500)
committerSage Weil <sage@redhat.com>
Tue, 21 Mar 2017 18:56:27 +0000 (13:56 -0500)
Notably, this includes WAL writes, which means an in-flight WAL write will
always be in the cache.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index c0821f969d42e7548c9c094f6e80097c32a39315..7a7dde46a8a02b34cb1308a786a77bc670292d6e 100644 (file)
@@ -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<std::mutex> l(o->flush_lock);