From: Samuel Just Date: Tue, 9 Apr 2013 21:53:52 +0000 (-0700) Subject: Journal: commits may not include all journaled seqs X-Git-Tag: v0.61~207^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4fa0a82007217ba5a71b5a7158fbfcb700fb4e7;p=ceph.git Journal: commits may not include all journaled seqs At one point, a commit had to drain the FileStore op queue. This is no longer the case. Consequently, the journal may have to wait more than one commit for the filestore to create a stable commit point at a particular sequence. Handling this requires two changes: 1) We cannot transition to FULL_WAIT until we receive a commit_start on a seq >= journaled_seq. 2) We cannot remove the journal completion plug until get a committed_thru on a seq >= header.start_seq at least as new as the oldest committed item in the journal. If on replay, the journal does not include fs_op_seq, we ignore it, which is fine since we won't have reported those entries committed! Signed-off-by: Samuel Just --- diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 8986490e6007..c99f1662f335 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -1490,8 +1490,18 @@ void FileJournal::commit_start(uint64_t seq) break; // all good case FULL_FULL: - dout(1) << " FULL_FULL -> FULL_WAIT. last commit epoch committed, waiting for a new one to start." << dendl; - full_state = FULL_WAIT; + if (seq >= journaled_seq) { + dout(1) << " FULL_FULL -> FULL_WAIT. commit_start on seq " + << seq << " > journaled_seq " << journaled_seq + << ", moving to FULL_WAIT." + << dendl; + full_state = FULL_WAIT; + } else { + dout(1) << "FULL_FULL commit_start on seq " + << seq << " < journaled_seq " << journaled_seq + << ", remaining in FULL_FULL" + << dendl; + } break; case FULL_WAIT: @@ -1537,7 +1547,7 @@ void FileJournal::committed_thru(uint64_t seq) Mutex::Locker locker(finisher_lock); // completions! queue_completions_thru(seq); - if (plug_journal_completions) { + if (plug_journal_completions && seq >= header.start_seq) { dout(10) << " removing completion plug, queuing completions thru journaled_seq " << journaled_seq << dendl; plug_journal_completions = false; queue_completions_thru(journaled_seq);