From afe2d81bcacbd98b1c53dd7b2a13ff827347462e Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 24 Feb 2011 12:42:16 -0800 Subject: [PATCH] Revert "FileStore: fix OpSequencer::flush error" 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 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 3e8cbc3718342..b7f261f63e9d8 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -109,7 +109,6 @@ class FileStore : public JournalingObjectStore { list q; list 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()); -- 2.39.5