diff --git a/db/db_impl_open.cc b/db/db_impl_open.cc index 28de2ad1a67..4f760e73760 100644 --- a/db/db_impl_open.cc +++ b/db/db_impl_open.cc @@ -763,6 +763,13 @@ Status DBImpl::RecoverLogFiles(const std::vector& log_numbers, // we just ignore the update. // That's why we set ignore missing column families to true bool has_valid_writes = false; + if (*next_sequence != kMaxSequenceNumber && sequence < *next_sequence) { + status = Status::Corruption( + "Sequence numbers in WAL not in increasing order: " + + NumberToString(sequence) + " < " + NumberToString(*next_sequence)); + reporter.Corruption(record.size(), status); + continue; + } status = WriteBatchInternal::InsertInto( &batch, column_family_memtables_.get(), &flush_scheduler_, true, log_number, this, false /* concurrent_memtable_writes */,