Fail IngestExternalFile when bg_error_ exists

Summary:
Fail IngestExternalFile() when bg_error_ exists
Closes https://github.com/facebook/rocksdb/pull/1881

Differential Revision: D4580621

Pulled By: IslamAbdelRahman

fbshipit-source-id: 1194913
main
Islam AbdelRahman 7 years ago committed by Facebook Github Bot
parent a618a16f44
commit fce7a6e196
  1. 7
      db/db_impl.cc

@ -6542,10 +6542,15 @@ Status DBImpl::IngestExternalFile(
immutable_db_options_, env_options_,
&snapshots_, ingestion_options);
// Make sure that bg cleanup wont delete the files that we are ingesting
std::list<uint64_t>::iterator pending_output_elem;
{
InstrumentedMutexLock l(&mutex_);
if (!bg_error_.ok()) {
// Don't ingest files when there is a bg_error
return bg_error_;
}
// Make sure that bg cleanup wont delete the files that we are ingesting
pending_output_elem = CaptureCurrentFileNumberInPendingOutputs();
}

Loading…
Cancel
Save