diff --git a/db/external_sst_file_ingestion_job.cc b/db/external_sst_file_ingestion_job.cc index 4042961c9..c4ec343c8 100644 --- a/db/external_sst_file_ingestion_job.cc +++ b/db/external_sst_file_ingestion_job.cc @@ -336,12 +336,14 @@ Status ExternalSstFileIngestionJob::GetIngestedFileInfo( // Set the global sequence number file_to_ingest->original_seqno = DecodeFixed64(seqno_iter->second.c_str()); - file_to_ingest->global_seqno_offset = props->properties_offsets.at( + auto offsets_iter = props->properties_offsets.find( ExternalSstFilePropertyNames::kGlobalSeqno); - - if (file_to_ingest->global_seqno_offset == 0) { + if (offsets_iter == props->properties_offsets.end() || + offsets_iter->second == 0) { + file_to_ingest->global_seqno_offset = 0; return Status::Corruption("Was not able to find file global seqno field"); } + file_to_ingest->global_seqno_offset = offsets_iter->second; } else if (file_to_ingest->version == 1) { // SST file V1 should not have global seqno field assert(seqno_iter == uprops.end());