Merge branch 'wip_4654' into next

Fixes: #wip_4654
Reviewed-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
Samuel Just 2013-04-10 14:00:13 -07:00
commit ac720a091d
4 changed files with 21 additions and 10 deletions

View File

@ -1480,7 +1480,7 @@ void FileJournal::pop_write()
writeq.pop_front();
}
void FileJournal::commit_start()
void FileJournal::commit_start(uint64_t seq)
{
dout(10) << "commit_start" << dendl;
@ -1490,8 +1490,18 @@ void FileJournal::commit_start()
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:
@ -1525,10 +1535,10 @@ void FileJournal::committed_thru(uint64_t seq)
}
if (!journalq.empty()) {
header.start = journalq.front().second;
header.start_seq = journalq.front().first + 1;
header.start_seq = journalq.front().first;
} else {
header.start = write_pos;
header.start_seq = journaled_seq + 1;
header.start_seq = seq + 1;
}
must_write_header = true;
print_header();
@ -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);

View File

@ -403,7 +403,7 @@ private:
void make_writeable();
// writes
void commit_start();
void commit_start(uint64_t seq);
void committed_thru(uint64_t seq);
bool should_commit_now() {
return full_state != FULL_NOTFULL;

View File

@ -60,7 +60,7 @@ public:
virtual void submit_entry(uint64_t seq, bufferlist& e, int alignment,
Context *oncommit,
TrackedOpRef osd_op = TrackedOpRef()) = 0;
virtual void commit_start() = 0;
virtual void commit_start(uint64_t seq) = 0;
virtual void committed_thru(uint64_t seq) = 0;
/// Read next journal entry - asserts on invalid journal

View File

@ -177,6 +177,7 @@ bool JournalingObjectStore::ApplyManager::commit_start()
{
bool ret = false;
uint64_t _committing_seq = 0;
{
Mutex::Locker l(apply_lock);
dout(10) << "commit_start max_applied_seq " << max_applied_seq
@ -198,7 +199,7 @@ bool JournalingObjectStore::ApplyManager::commit_start()
goto out;
}
committing_seq = max_applied_seq;
_committing_seq = committing_seq = max_applied_seq;
dout(10) << "commit_start committing " << committing_seq
<< ", still blocked" << dendl;
@ -208,7 +209,7 @@ bool JournalingObjectStore::ApplyManager::commit_start()
out:
if (journal)
journal->commit_start(); // tell the journal too
journal->commit_start(_committing_seq); // tell the journal too
return ret;
}