diff --git a/db/external_sst_file_ingestion_job.cc b/db/external_sst_file_ingestion_job.cc index 898939afcd0b0e611120f2ce2745754c680f7764..8c29635089f95996d7b187c568e438ca75fc0f21 100644 --- a/db/external_sst_file_ingestion_job.cc +++ b/db/external_sst_file_ingestion_job.cc @@ -473,7 +473,10 @@ Status ExternalSstFileIngestionJob::AssignLevelAndSeqnoForIngestedFile( return f1->largest_seqno < f2->largest_seqno; })) ->largest_seqno; - if (level_largest_seqno != 0) { + // should only assign seqno to current level's largest seqno when + // the file fits + if (level_largest_seqno != 0 && + IngestedFileFitInLevel(file_to_ingest, lvl)) { *assigned_seqno = level_largest_seqno; } else { continue;