rocksdb/db/db_impl
Yanqin Jin edda219fc3 Manual flush with wait=false should not stall when writes stopped (#10001)
Summary:
When `FlushOptions::wait` is set to false, manual flush should not stall forever.

If the database has already stopped writes, then the thread calling `DB::Flush()` with
`FlushOptions::wait=false` should not enter the `DBImpl::write_thread_`.

To prevent this, we should do a check at the beginning and return `TryAgain()`

Resolves: https://github.com/facebook/rocksdb/issues/9892

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

Reviewed By: siying

Differential Revision: D36422303

Pulled By: siying

fbshipit-source-id: 723bd3065e8edc4f17c82449d0d6b95a2381ac0a
2022-10-04 16:43:01 -07:00
..
compacted_db_impl.cc Fix periodic_task unable to re-register the same task type (#10379) 2022-08-25 18:52:37 -07:00
compacted_db_impl.h Don't wait for indirect flush in read-only DB (#10569) 2022-08-29 13:36:23 -07:00
db_impl.cc Manual flush with wait=false should not stall when writes stopped (#10001) 2022-10-04 16:43:01 -07:00
db_impl.h Manual flush with wait=false should not stall when writes stopped (#10001) 2022-10-04 16:43:01 -07:00
db_impl_compaction_flush.cc Manual flush with wait=false should not stall when writes stopped (#10001) 2022-10-04 16:43:01 -07:00
db_impl_debug.cc Add manual_wal_flush, FlushWAL() to stress/crash test (#10698) 2022-09-30 15:48:33 -07:00
db_impl_experimental.cc Remove unused fields from FileMetaData (temporarily) (#10443) 2022-08-01 17:56:13 -07:00
db_impl_files.cc Add new property in IOOptions to skip recursing through directories and list only files during GetChildren. (#10668) 2022-10-03 10:59:45 -07:00
db_impl_open.cc Add new property in IOOptions to skip recursing through directories and list only files during GetChildren. (#10668) 2022-10-03 10:59:45 -07:00
db_impl_readonly.cc Skip swaths of range tombstone covered keys in merging iterator (2022 edition) (#10449) 2022-09-02 09:51:19 -07:00
db_impl_readonly.h Don't wait for indirect flush in read-only DB (#10569) 2022-08-29 13:36:23 -07:00
db_impl_secondary.cc Add new property in IOOptions to skip recursing through directories and list only files during GetChildren. (#10668) 2022-10-03 10:59:45 -07:00
db_impl_secondary.h Don't wait for indirect flush in read-only DB (#10569) 2022-08-29 13:36:23 -07:00
db_impl_write.cc Manual flush with wait=false should not stall when writes stopped (#10001) 2022-10-04 16:43:01 -07:00