osd update the journal header when ceph call FileStore::sync_entry(
ApplyManager::commit_finish -> FileJournal::committed_thru).
But, it doesnot write the journal head until the next transaction
(calling do_write or do_aio_write).
So write jouranl header when journal write close, so that
committed_up_to in journal header is new enough. ceph may
not replay some transaction which has been writen to filestore.
Signed-off-by: Xinze Chi <xmdxcxz@gmail.com>
(cherry picked from commit
8f80ae3fbaba7b0e64b6e4df6c2dddd10ac50e5a)
commit_cond.Signal();
}
write_thread.join();
+
+ // write jouranl header right now, so that
+ // committed_up_to in journal header is newer enough.
+ write_header();
#ifdef HAVE_LIBAIO
// stop aio completeion thread *after* writer thread has stopped
return bp;
}
-
+void FileJournal::write_header()
+{
+ Mutex::Locker locker(write_lock);
+ must_write_header = true;
+ bufferlist bl;
+ do_write(bl);
+ dout(20) << __func__ << " finish" << dendl;
+}
int FileJournal::check_for_full(uint64_t seq, off64_t pos, off64_t size)
{
return full_state != FULL_NOTFULL && !write_stop;
}
+ void write_header();
+
void set_wait_on_full(bool b) { wait_on_full = b; }
// reads