summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-04-16 08:26:47 -0700
committerSamuel Just <sam.just@inktank.com>2013-04-16 13:20:58 -0700
commit02d3c114ab869b0ddc4d26c68e8b9e3391e7ad1b (patch)
treea6de41d50c474c9e79213b6ee1205a2b422d90ec
parent4a84ddbd30ef3cc105053f272819c2f1ea2be0d2 (diff)
downloadceph-02d3c114ab869b0ddc4d26c68e8b9e3391e7ad1b.tar.gz
os/FileJournal: fix journal completion plug removal
We plug completions when transitioning from a full to non-full journal to ensure that we do not complete items before we have a stable journal starting point that is past the committed_thru marker. However, the order of the header update and completion queueing means that we never remove the plug if the journalq is empty--the seq test is always false. The result is very slow osd requests that only commit when we do a full sync. This bug was masked until recently by another issue, fixed in 170d4a3d794260476ecde1e5e2ee719b7cb3ffd1. The simple fix is to reorder the completion queuing before we update the new header. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/os/FileJournal.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc
index d8a6f5a1a68..6e5f94c64e5 100644
--- a/src/os/FileJournal.cc
+++ b/src/os/FileJournal.cc
@@ -1529,6 +1529,17 @@ void FileJournal::committed_thru(uint64_t seq)
dout(5) << "committed_thru " << seq << " (last_committed_seq " << last_committed_seq << ")" << dendl;
last_committed_seq = seq;
+ // completions!
+ {
+ Mutex::Locker locker(finisher_lock);
+ queue_completions_thru(seq);
+ 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);
+ }
+ }
+
// adjust start pointer
while (!journalq.empty() && journalq.front().first <= seq) {
journalq.pop_front();
@@ -1543,17 +1554,6 @@ void FileJournal::committed_thru(uint64_t seq)
must_write_header = true;
print_header();
- {
- Mutex::Locker locker(finisher_lock);
- // completions!
- queue_completions_thru(seq);
- 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);
- }
- }
-
// committed but unjournaled items
while (!writeq_empty() && peek_write().seq <= seq) {
dout(15) << " dropping committed but unwritten seq " << peek_write().seq