From fce7a6e196ef3d51e25ca8a821cdcd17c36b44ee Mon Sep 17 00:00:00 2001 From: Islam AbdelRahman Date: Fri, 17 Feb 2017 13:36:46 -0800 Subject: [PATCH] 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 --- db/db_impl.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index a948965ec..1cadb4b0a 100644 --- a/db/db_impl.cc +++ b/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::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(); } -- GitLab