Skip to content

Commit

Permalink
fix version-check for ingested sst (#257)
Browse files Browse the repository at this point in the history
* fix check log seqno

Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: tabokie <[email protected]>
  • Loading branch information
Little-Wallace authored and tabokie committed May 12, 2022
1 parent 8bd42ca commit 545d0b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion db/version_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,12 @@ class VersionBuilder::Rep {
// This is an external file that we ingested
const SequenceNumber external_file_seqno = rhs->fd.smallest_seqno;

if (!(external_file_seqno < lhs->fd.largest_seqno ||
// If lhs and rhs are both ingested files, their seqno may be same.
// Because RocksDB will assign only one seqno for all files ingested
// in once call by `IngestExternalFile`.
if (!((lhs->fd.smallest_seqno == lhs->fd.largest_seqno &&
lhs->fd.smallest_seqno == external_file_seqno) ||
external_file_seqno < lhs->fd.largest_seqno ||
external_file_seqno == 0)) {
std::ostringstream oss;
oss << "L0 file #" << lhs->fd.GetNumber() << " with seqno "
Expand Down

0 comments on commit 545d0b2

Please sign in to comment.