Islam AbdelRahman 9bd191d2f4 Fix deadlock between (WriterThread/Compaction/IngestExternalFile)
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
2016-11-09 10:54:10 -08:00
..
2016-10-31 20:54:18 -07:00
2016-10-31 20:54:18 -07:00
2016-11-03 18:54:20 -07:00
2016-09-13 21:11:59 -07:00
2016-11-03 18:54:20 -07:00
2016-11-04 12:09:22 -07:00
2016-11-04 12:09:22 -07:00
2016-11-04 12:09:22 -07:00
2016-09-27 18:20:57 -07:00
2016-10-31 20:54:18 -07:00
2016-10-31 20:54:18 -07:00
2016-07-08 17:50:51 -07:00
2016-09-27 18:20:57 -07:00
2016-09-21 20:22:09 -07:00
2016-10-13 08:48:40 -07:00
2016-07-08 17:50:51 -07:00
2016-11-03 18:54:20 -07:00
2016-11-03 18:54:20 -07:00
2016-11-03 18:54:20 -07:00
2016-10-31 20:54:18 -07:00
2016-09-27 18:20:57 -07:00
2016-09-27 18:20:57 -07:00
2016-07-13 15:36:22 -07:00
2016-06-25 08:29:40 +01:00