Skip to content

Commit

Permalink
Cover all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
shuzhang1989 committed Jan 18, 2017
1 parent 3ce091f commit 6c97993
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion db/external_sst_file_ingestion_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ void ExternalSstFileIngestionJob::Cleanup(const Status& status) {

Status ExternalSstFileIngestionJob::GetIngestedFileInfo(
const std::string& external_file, IngestedFileInfo* file_to_ingest) {
static std::set<int> supported_versions = {1,2};
file_to_ingest->external_file_path = external_file;

// Get external file size
Expand Down Expand Up @@ -306,7 +307,13 @@ Status ExternalSstFileIngestionJob::GetIngestedFileInfo(
if (file_to_ingest->global_seqno_offset == 0) {
return Status::Corruption("Was not able to find file global seqno field");
}
} else {
} else if (file_to_ingest->version == 1 &&
(ingestion_options_.allow_blocking_flush == true ||
ingestion_options_.allow_global_seqno == true)) {
return Status::InvalidArgument(
"external file's version number is not correct");
} else if (supported_versions.find(file_to_ingest->version) ==
supported_versions.end()){
return Status::InvalidArgument("external file version is not supported");
}
// Get number of entries in table
Expand Down

0 comments on commit 6c97993

Please sign in to comment.