Skip to content

Commit

Permalink
DBImpl::IngestExternalFile() should grab mutex when releasing file nu…
Browse files Browse the repository at this point in the history
…mber in failure case (facebook#4189)

Summary:
995fcf7 has a bug: ReleaseFileNumberFromPendingOutputs() added is not protected by the DB mutex. Fix it by grabbing the lock for this operation.
Pull Request resolved: facebook#4189

Differential Revision: D9015447

Pulled By: siying

fbshipit-source-id: b8506e09a96c3f95a6fe32b5ca5fcdb9bee88937
  • Loading branch information
siying authored and facebook-github-bot committed Jul 26, 2018
1 parent 2a81633 commit fd45495
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2912,6 +2912,7 @@ Status DBImpl::IngestExternalFile(
status = ingestion_job.Prepare(external_files, super_version);
CleanupSuperVersion(super_version);
if (!status.ok()) {
InstrumentedMutexLock l(&mutex_);
ReleaseFileNumberFromPendingOutputs(pending_output_elem);
return status;
}
Expand Down

0 comments on commit fd45495

Please sign in to comment.