summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-04-10 14:00:13 -0700
committerSamuel Just <sam.just@inktank.com>2013-04-10 14:00:13 -0700
commitac720a091ddb1d32d658742080c6ed9b31af2128 (patch)
tree9dc9e00be570cddc231044b68589e96e50a989bd
parent351d9b270f0fe515e7276ef82819aa0720ca2421 (diff)
parent170d4a3d794260476ecde1e5e2ee719b7cb3ffd1 (diff)
downloadceph-ac720a091ddb1d32d658742080c6ed9b31af2128.tar.gz
Merge branch 'wip_4654' into next
Fixes: #wip_4654 Reviewed-by: Greg Farnum <greg@inktank.com>
-rw-r--r--src/os/FileJournal.cc22
-rw-r--r--src/os/FileJournal.h2
-rw-r--r--src/os/Journal.h2
-rw-r--r--src/os/JournalingObjectStore.cc5
4 files changed, 21 insertions, 10 deletions
diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc
index 29139c12bca..d8a6f5a1a68 100644
--- a/src/os/FileJournal.cc
+++ b/src/os/FileJournal.cc
@@ -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);
diff --git a/src/os/FileJournal.h b/src/os/FileJournal.h
index 0e826fb4940..38e32324dca 100644
--- a/src/os/FileJournal.h
+++ b/src/os/FileJournal.h
@@ -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;
diff --git a/src/os/Journal.h b/src/os/Journal.h
index 8241edc783d..1d413bb4c53 100644
--- a/src/os/Journal.h
+++ b/src/os/Journal.h
@@ -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
diff --git a/src/os/JournalingObjectStore.cc b/src/os/JournalingObjectStore.cc
index e65f010443f..e662580ac42 100644
--- a/src/os/JournalingObjectStore.cc
+++ b/src/os/JournalingObjectStore.cc
@@ -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;
}