Skip to content

Commit 7e9c960

Browse files
hx235facebook-github-bot
authored andcommitted
Improve two error messages on WAL recovery (facebook#13876)
Summary: **Context/Summary:** ... for better readability Pull Request resolved: facebook#13876 Test Plan: Existing UT Reviewed By: mszeszko-meta Differential Revision: D80185817 Pulled By: hx235 fbshipit-source-id: 534d37dd747369da48fc5903acc66bb9c8f5206d
1 parent 8f0ab15 commit 7e9c960

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

db/db_impl/db_impl_open.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,8 +1755,12 @@ Status DBImpl::MaybeHandleStopReplayForCorruptionForInconsistency(
17551755
ROCKS_LOG_ERROR(immutable_db_options_.info_log,
17561756
"Column family inconsistency: SST file contains data"
17571757
" beyond the point of corruption.");
1758-
status = Status::Corruption("SST file is ahead of WALs in CF " +
1759-
cfd->GetName());
1758+
status = Status::Corruption(
1759+
"Column family inconsistency: SST file contains data"
1760+
" beyond the point of corruption in CF " +
1761+
cfd->GetName() +
1762+
". WAL recovery stopped at corruption point, but SST files"
1763+
" contain newer data.");
17601764
return status;
17611765
}
17621766
}

db/log_reader.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,11 @@ void Reader::MaybeVerifyPredecessorWALInfo(
380380
} else {
381381
if (observed_predecessor_wal_info_.GetLogNumber() !=
382382
recorded_predecessor_log_number) {
383-
std::string reason = "Missing WAL of log number " +
384-
std::to_string(recorded_predecessor_log_number);
383+
std::string reason =
384+
"Mismatched predecessor log number of WAL file " +
385+
file_->file_name() + " Recorded " +
386+
std::to_string(recorded_predecessor_log_number) + ". Observed " +
387+
std::to_string(observed_predecessor_wal_info_.GetLogNumber());
385388
ReportCorruption(fragment.size(), reason.c_str(),
386389
recorded_predecessor_log_number);
387390
} else if (observed_predecessor_wal_info_.GetLastSeqnoRecorded() !=

0 commit comments

Comments
 (0)