rocksdb/db/db_impl
sdong a3960fc875 Move pipeline write waiting logic into WaitForPendingWrites() (#5716)
Summary:
In pipeline writing mode, memtable switching needs to wait for memtable writing to finish to make sure that when memtables are made immutable, inserts are not going to them. This is currently done in DBImpl::SwitchMemtable(). This is done after flush_scheduler_.TakeNextColumnFamily() is called to fetch the list of column families to switch. The function flush_scheduler_.TakeNextColumnFamily() itself, however, is not thread-safe when being called together with flush_scheduler_.ScheduleFlush().
This change provides a fix, which moves the waiting logic before flush_scheduler_.TakeNextColumnFamily(). WaitForPendingWrites() is a natural place where the logic can happen.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5716

Test Plan: Run all tests with ASAN and TSAN.

Differential Revision: D18217658

fbshipit-source-id: b9c5e765c9989645bf10afda7c5c726c3f82f6c3
2019-10-29 18:16:36 -07:00
..
db_impl_compaction_flush.cc Propagate SST and blob file numbers through the EventListener interface (#5962) 2019-10-24 14:44:15 -07:00
db_impl_debug.cc Add command "list_file_range_deletes" in ldb (#5615) 2019-08-15 17:01:03 -07:00
db_impl_experimental.cc BlobDB GC: add SST <-> oldest blob file referenced mapping (#5903) 2019-10-14 15:21:01 -07:00
db_impl_files.cc Move WAL-closing loop out of original loop (#5804) 2019-09-17 17:17:19 -07:00
db_impl_open.cc Update column families' log number altogether after flushing during recovery (#5856) 2019-10-24 18:29:30 -07:00
db_impl_readonly.cc Apply formatter on recent 45 commits. (#5827) 2019-09-19 12:34:17 -07:00
db_impl_readonly.h Use delete to disable automatic generated methods. (#5009) 2019-09-11 18:09:00 -07:00
db_impl_secondary.cc Apply formatter to recent 200+ commits. (#5830) 2019-09-20 12:04:26 -07:00
db_impl_secondary.h Override check consistency for DBImplSecondary (#5469) 2019-06-17 15:39:55 -07:00
db_impl_write.cc Move pipeline write waiting logic into WaitForPendingWrites() (#5716) 2019-10-29 18:16:36 -07:00
db_impl.cc API to get file_creation_time of the oldest file in the DB (#5948) 2019-10-25 11:53:57 -07:00
db_impl.h Move pipeline write waiting logic into WaitForPendingWrites() (#5716) 2019-10-29 18:16:36 -07:00
db_secondary_test.cc Apply formatter to recent 200+ commits. (#5830) 2019-09-20 12:04:26 -07:00