]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: add OpSequencer::drain()
authorSage Weil <sage@redhat.com>
Tue, 14 Mar 2017 02:49:37 +0000 (22:49 -0400)
committerSage Weil <sage@redhat.com>
Tue, 21 Mar 2017 18:56:27 +0000 (13:56 -0500)
Currently this is the same as flush, but more precisely it is an internal
method that means all txc's must complete.  Update _wal_apply() to use it
instead of flush(), which is part of the public Sequencer interface.

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

index 4fae0a27fa32abcdb32e3a8388cbcb20dd7abeda..374e55c5736b3d33d5ae769d9204888de28a0ec6 100644 (file)
@@ -7775,8 +7775,8 @@ int BlueStore::_deferred_replay()
     txc->state = TransContext::STATE_KV_DONE;
     _txc_state_proc(txc);
   }
-  dout(20) << __func__ << " flushing osr" << dendl;
-  osr->flush();
+  dout(20) << __func__ << " draining osr" << dendl;
+  osr->drain();
   dout(10) << __func__ << " completed " << count << " events" << dendl;
   return 0;
 }
index a9ee843954f8e6aee8094f4276e2efafb9b32a65..2e428d1cea302f77476e57c69169af54d54c19f3 100644 (file)
@@ -1554,13 +1554,19 @@ public:
       q.push_back(*txc);
     }
 
-    void flush() {
+    void flush() override {
+      std::unique_lock<std::mutex> l(qlock);
+      while (!q.empty())
+       qcond.wait(l);
+    }
+
+    void drain() {
       std::unique_lock<std::mutex> l(qlock);
       while (!q.empty())
        qcond.wait(l);
     }
 
-    bool flush_commit(Context *c) {
+    bool flush_commit(Context *c) override {
       std::lock_guard<std::mutex> l(qlock);
       if (q.empty()) {
        return true;