提交 fd45495c 编写于 作者: S Siying Dong 提交者: Facebook Github Bot

DBImpl::IngestExternalFile() should grab mutex when releasing file number in failure case (#4189)

Summary:
995fcf75 has a bug: ReleaseFileNumberFromPendingOutputs() added is not protected by the DB mutex. Fix it by grabbing the lock for this operation.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4189

Differential Revision: D9015447

Pulled By: siying

fbshipit-source-id: b8506e09a96c3f95a6fe32b5ca5fcdb9bee88937
上级 2a81633d
...@@ -2912,6 +2912,7 @@ Status DBImpl::IngestExternalFile( ...@@ -2912,6 +2912,7 @@ Status DBImpl::IngestExternalFile(
status = ingestion_job.Prepare(external_files, super_version); status = ingestion_job.Prepare(external_files, super_version);
CleanupSuperVersion(super_version); CleanupSuperVersion(super_version);
if (!status.ok()) { if (!status.ok()) {
InstrumentedMutexLock l(&mutex_);
ReleaseFileNumberFromPendingOutputs(pending_output_elem); ReleaseFileNumberFromPendingOutputs(pending_output_elem);
return status; return status;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册