]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "FileStore: fix OpSequencer::flush error"
authorSamuel Just <samuel.just@dreamhost.com>
Thu, 24 Feb 2011 20:42:16 +0000 (12:42 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Thu, 24 Feb 2011 21:40:56 +0000 (13:40 -0800)
This reverts commit c78b29a47d7211a4b8b1585112ac22b8435a82c7.

This commit introduced an error in parallel journaling mode.
OpSequencer::flush is only meant to ensure that the ops have become
readable, not necessarily journalled.

src/os/FileStore.h

index 3e8cbc37183421838cfcab594a1bf35f6b7e67ce..b7f261f63e9d8c1fd98e6657218a41e4f485f634 100644 (file)
@@ -109,7 +109,6 @@ class FileStore : public JournalingObjectStore {
     list<Op*> q;
     list<uint64_t> jq;
     Cond cond;
-    uint64_t last_thru_q, last_thru_jq; // Last op to drain through each q
   public:
     Sequencer *parent;
     Mutex apply_lock;  // for apply mutual exclusion
@@ -120,8 +119,6 @@ class FileStore : public JournalingObjectStore {
     }
     void dequeue_journal() {
       Mutex::Locker l(qlock);
-      assert(jq.front() > last_thru_jq);
-      last_thru_jq = jq.front();
       jq.pop_front();
       cond.Signal();
     }
@@ -137,8 +134,6 @@ class FileStore : public JournalingObjectStore {
       assert(apply_lock.is_locked());
       Mutex::Locker l(qlock);
       Op *o = q.front();
-      assert(o->op > last_thru_q);
-      last_thru_q = o->op;
       q.pop_front();
       cond.Signal();
       return o;
@@ -155,13 +150,13 @@ class FileStore : public JournalingObjectStore {
 
       if (seq) {
        // everything prior to our watermark to drain through either/both queues
-       while (last_thru_q < seq || last_thru_jq < seq)
+       while ((!q.empty() && q.front()->op <= seq) ||
+              (!jq.empty() && jq.front() <= seq))
          cond.Wait(qlock);
       }
     }
 
     OpSequencer() : qlock("FileStore::OpSequencer::qlock", false, false),
-                   last_thru_q(0), last_thru_jq(0),
                    apply_lock("FileStore::OpSequencer::apply_lock", false, false) {}
     ~OpSequencer() {
       assert(q.empty());