From dc167bac7800c75df971bded4b54e0de48f7b18f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 5 Dec 2011 09:34:44 -0800 Subject: [PATCH] filejournal: set last_committed_seq based on fs, not journal last_committed_seq is the last seq committed to the fs, not the journal. Set it when we begin replay with the fs provided value, not from the newest entry in the journal. Signed-off-by: Sage Weil --- src/os/FileJournal.cc | 3 ++- src/os/JournalingObjectStore.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index fb409332a86f4..29f9cdae79557 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -391,6 +391,8 @@ int FileJournal::open(uint64_t next_seq) { dout(2) << "open " << fn << " next_seq " << next_seq << dendl; + last_committed_seq = next_seq - 1; + int err = _open(false); if (err < 0) return err; @@ -1171,7 +1173,6 @@ bool FileJournal::read_entry(bufferlist& bl, uint64_t& seq) assert(h->seq >= last_committed_seq); return false; } - last_committed_seq = h->seq; // ok! seq = h->seq; diff --git a/src/os/JournalingObjectStore.cc b/src/os/JournalingObjectStore.cc index 095f2856d437d..baaf459b971cd 100644 --- a/src/os/JournalingObjectStore.cc +++ b/src/os/JournalingObjectStore.cc @@ -38,8 +38,8 @@ int JournalingObjectStore::journal_replay(uint64_t fs_op_seq) } op_seq = fs_op_seq; - committed_seq = op_seq; - committing_seq = op_seq; + committed_seq = fs_op_seq; + committing_seq = fs_op_seq; applied_seq = fs_op_seq; if (!journal) -- 2.39.5