• I
    Fix deadlock between (WriterThread/Compaction/IngestExternalFile) · 9bd191d2
    Islam AbdelRahman 提交于
    Summary:
    A deadlock is possible if this happen
    
    (1) Writer thread is stopped because it's waiting for compaction to finish
    (2) Compaction is waiting for current IngestExternalFile() calls to finish
    (3) IngestExternalFile() is waiting to be able to acquire the writer thread
    (4) WriterThread is held by stopped writes that are waiting for compactions to finish
    
    This patch fix the issue by not incrementing num_running_ingest_file_ except when we acquire the writer thread.
    
    This patch include a unittest to reproduce the described scenario
    Closes https://github.com/facebook/rocksdb/pull/1480
    
    Differential Revision: D4151646
    
    Pulled By: IslamAbdelRahman
    
    fbshipit-source-id: 09b39db
    9bd191d2
external_sst_file_test.cc 60.7 KB