If we read an event that's later than our expected entry, we set read_pos
to -1 and discard the journal. If that happens we also need to reset
last_committed_seq to avoid a crash like
2010-12-08 17:04:39.246950
7f269d138910 journal commit_finish thru 16904
2010-12-08 17:04:39.246961
7f269d138910 journal committed_thru 16904 < last_committed_seq
37778589
os/FileJournal.cc: In function 'virtual void FileJournal::committed_thru(uint64_t)':
os/FileJournal.cc:854: FAILED assert(seq >= last_committed_seq)
ceph version 0.24~rc (commit:
fe10300317383ec29948d7dbe3cb31b3aa277e3c)
1: (FileJournal::committed_thru(unsigned long)+0xad) [0x588e7d]
2: (JournalingObjectStore::commit_finish()+0x8c) [0x57f2ec]
3: (FileStore::sync_entry()+0xcff) [0x5764cf]
4: (FileStore::SyncThread::entry()+0xd) [0x506d9d]
5: (Thread::_entry_func(void*)+0xa) [0x4790ba]
6: /lib/libpthread.so.0 [0x7f26a2f8373a]
7: (clone()+0x6d) [0x7f26a1c2569d]
Fixes #631
Signed-off-by: Sage Weil <sage@newdream.net>
break;
}
if (seq > next_seq) {
- dout(10) << "open entry " << seq << " len " << bl.length() << " > next_seq " << next_seq << dendl;
+ dout(10) << "open entry " << seq << " len " << bl.length() << " > next_seq " << next_seq
+ << ", ignoring journal contents"
+ << dendl;
read_pos = -1;
+ last_committed_seq = 0;
+ seq = 0;
return 0;
}
if (seq == next_seq) {