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

Tolerate invalid seqnum in LogMgr::getLastSyncedSeqNum #164

Merged
merged 1 commit into from
Jan 30, 2024
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
5 changes: 5 additions & 0 deletions src/log_mgr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,10 @@ Status LogMgr::getLastSyncedSeqNum(uint64_t& seq_num_out) {
LogFileInfoGuard li(mani->getLogFileInfoP(ln_sync, true));
if (li.empty() || li.ptr->isRemoved()) continue;
sync_seq = li->file->getSyncedSeqNum();

// NOTE: `sync_seq` can be INVALID, if the DB does not contain any data.
// It is not a bug.
#if 0
if (!valid_number(sync_seq)) {
// This should be a bug.
_log_err( myLog, "log file %zu returned invalid seq number, "
Expand All @@ -1851,6 +1855,7 @@ Status LogMgr::getLastSyncedSeqNum(uint64_t& seq_num_out) {
li->file->isMemTablePurged() );
assert(0);
}
#endif
break;
}

Expand Down
Loading