From: Samuel Just Date: Tue, 12 Nov 2013 21:39:04 +0000 (-0800) Subject: JounralingObjectStore: journal->committed_thru after replay X-Git-Tag: v0.73~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d8d27f13e11dcaefd3aa1c049b97c980283da575;p=ceph.git JounralingObjectStore: journal->committed_thru after replay It's possible that the osd stopped between when the filestore op_seq file was updated and when the journal was trimmed. In that case, it's possible that on boot the journal might be full, and yet not be trimmed because commit_start assumes there is no work to do. Calling committed_thru on the journal ensures that the journal matches committed_seq. Backport: emperor dumpling Fixes: 6756 Signed-off-by: Samuel Just Reviewed-by: Josh Durgin Reviewed-by: David Zafman --- diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 4a2af08dd4c0..287f4b676717 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -469,7 +469,6 @@ int FileJournal::open(uint64_t fs_op_seq) { dout(2) << "open " << fn << " fsid " << fsid << " fs_op_seq " << fs_op_seq << dendl; - last_committed_seq = fs_op_seq; uint64_t next_seq = fs_op_seq + 1; int err = _open(false); @@ -528,6 +527,11 @@ int FileJournal::open(uint64_t fs_op_seq) // find next entry read_pos = header.start; uint64_t seq = header.start_seq; + + // last_committed_seq is 1 before the start of the journal or + // 0 if the start is 0 + last_committed_seq = seq > 0 ? seq - 1 : seq; + while (1) { bufferlist bl; off64_t old_pos = read_pos; diff --git a/src/os/JournalingObjectStore.cc b/src/os/JournalingObjectStore.cc index e662580ac42b..4147ced8a3ab 100644 --- a/src/os/JournalingObjectStore.cc +++ b/src/os/JournalingObjectStore.cc @@ -100,6 +100,8 @@ int JournalingObjectStore::journal_replay(uint64_t fs_op_seq) // done reading, make writeable. journal->make_writeable(); + journal->committed_thru(fs_op_seq); + return count; }