rocksdb/port/win
Andrew Kryczka 791bff5b4e Prevent deadlock in db_stress with DbStressCompactionFilter (#8956)
Summary:
The cyclic dependency was:

- `StressTest::OperateDb()` locks the mutex for key 'k'
- `StressTest::OperateDb()` calls a function like `PauseBackgroundWork()`, which waits for pending compaction to complete.
- The pending compaction reaches key `k` and `DbStressCompactionFilter::FilterV2()` calls `Lock()` on that key's mutex, which hangs forever.

The cycle can be broken by using a new function, `port::Mutex::TryLock()`, which returns immediately upon failure to acquire a lock. In that case `DbStressCompactionFilter::FilterV2()` can just decide to keep the key.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8956

Reviewed By: riversand963

Differential Revision: D31183718

Pulled By: ajkr

fbshipit-source-id: 329e4a31ce43085af174cf367ef560b5a04399c5
2021-09-24 16:54:02 -07:00
..
env_default.cc Create a CustomEnv class; Add WinFileSystem; Make LegacyFileSystemWrapper private (#7703) 2021-01-06 10:49:32 -08:00
env_win.cc Replace most typedef with using= (#8751) 2021-09-07 11:31:59 -07:00
env_win.h Make SystemClock into a Customizable Class (#8636) 2021-09-21 09:23:48 -07:00
io_win.cc Support dynamic sector size in alignment validation for Windows. (#8613) 2021-08-16 07:31:57 -07:00
io_win.h Support dynamic sector size in alignment validation for Windows. (#8613) 2021-08-16 07:31:57 -07:00
port_win.cc Built-in support for generating unique IDs, bug fix (#8708) 2021-08-30 15:20:41 -07:00
port_win.h Prevent deadlock in db_stress with DbStressCompactionFilter (#8956) 2021-09-24 16:54:02 -07:00
win_jemalloc.cc build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
win_logger.cc Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
win_logger.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
win_thread.cc Allow using WindowsThread with Mingw (#8108) 2021-06-29 06:52:08 -07:00
win_thread.h Replace most typedef with using= (#8751) 2021-09-07 11:31:59 -07:00
xpress_win.cc Introduce a helper method UncompressData (#7434) 2020-09-25 09:01:45 -07:00
xpress_win.h Introduce a helper method UncompressData (#7434) 2020-09-25 09:01:45 -07:00