summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Just <samuel.just@dreamhost.com>2012-04-21 01:57:48 +0200
committerSage Weil <sage@newdream.net>2012-04-21 02:01:21 +0200
commit888a082f23974b1f7a63f302e29a326182e7dc41 (patch)
tree31b4973afce50875e5a191ec499c962a1b472eff
parentfilestore: fix collection_add journal replay problem (diff)
downloadceph-888a082f23974b1f7a63f302e29a326182e7dc41.tar.xz
ceph-888a082f23974b1f7a63f302e29a326182e7dc41.zip
FileJournal: don't wait flusher until completions are queued
Fixes: #2324 Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
-rw-r--r--src/os/FileJournal.cc39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc
index 407f74e2b6f..c70b7cc7f9e 100644
--- a/src/os/FileJournal.cc
+++ b/src/os/FileJournal.cc
@@ -1024,35 +1024,36 @@ void FileJournal::do_write(bufferlist& bl)
write_lock.Lock();
- {
- Mutex::Locker locker(flush_lock);
- writing = false;
- write_empty_cond.Signal();
- }
-
// wrap if we hit the end of the journal
if (pos == header.max_size)
pos = get_top();
write_pos = pos;
assert(write_pos % header.alignment == 0);
- Mutex::Locker locker(queue_lock);
- journaled_seq = writing_seq;
+ {
+ Mutex::Locker locker(queue_lock);
+ journaled_seq = writing_seq;
- // kick finisher?
- // only if we haven't filled up recently!
- if (full_state != FULL_NOTFULL) {
- dout(10) << "do_write NOT queueing finisher seq " << journaled_seq
- << ", full_commit_seq|full_restart_seq" << dendl;
- } else {
- if (plug_journal_completions) {
- dout(20) << "do_write NOT queueing finishers through seq " << journaled_seq
- << " due to completion plug" << dendl;
+ // kick finisher?
+ // only if we haven't filled up recently!
+ if (full_state != FULL_NOTFULL) {
+ dout(10) << "do_write NOT queueing finisher seq " << journaled_seq
+ << ", full_commit_seq|full_restart_seq" << dendl;
} else {
- dout(20) << "do_write queueing finishers through seq " << journaled_seq << dendl;
- queue_completions_thru(journaled_seq);
+ if (plug_journal_completions) {
+ dout(20) << "do_write NOT queueing finishers through seq " << journaled_seq
+ << " due to completion plug" << dendl;
+ } else {
+ dout(20) << "do_write queueing finishers through seq " << journaled_seq << dendl;
+ queue_completions_thru(journaled_seq);
+ }
}
}
+ {
+ Mutex::Locker locker(flush_lock);
+ writing = false;
+ write_empty_cond.Signal();
+ }
}
void FileJournal::flush()