Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db_impl_open: Error out if WAL replay seqnums aren't increasing #78

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions db/db_impl_open.cc
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,13 @@ Status DBImpl::RecoverLogFiles(const std::vector<uint64_t>& 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 */,
Expand Down