rocksdb/db/db_impl
Connor a844591201 wait pending memtable writes on file ingestion or compact range (#6113)
Summary:
**Summary:**
This PR fixes two unordered_write related issues:
- ingestion job may skip the necessary memtable flush https://github.com/facebook/rocksdb/issues/6026
- compact range may cause memtable is flushed before pending unordered write finished
    1. `CompactRange` triggers memtable flush but doesn't wait for pending-writes
    2.  there are some pending writes but memtable is already flushed
    3.  the memtable related WAL is removed( note that the pending-writes were recorded in that WAL).
    4.  pending-writes write to newer created memtable
    5. there is a restart
    6. missing the previous pending-writes because WAL is removed but they aren't included in SST.

**How to solve:**
- Wait pending memtable writes before ingestion job check memtable key range
- Wait pending memtable writes before flush memtable.
**Note that: `CompactRange` calls `RangesOverlapWithMemtables` too without waiting for pending waits, but I'm not sure whether it affects the correctness.**

**Test Plan:**
make check
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6113

Differential Revision: D18895674

Pulled By: maysamyabandeh

fbshipit-source-id: da22b4476fc7e06c176020e7cc171eb78189ecaf
2019-12-12 14:08:02 -08:00
..
db_impl_compaction_flush.cc wait pending memtable writes on file ingestion or compact range (#6113) 2019-12-12 14:08:02 -08:00
db_impl_debug.cc Fix IngestExternalFile's bug with two_write_queue (#5976) 2019-11-15 14:00:37 -08:00
db_impl_experimental.cc Support options.max_open_files = -1 with periodic_compaction_seconds (#6090) 2019-11-26 21:39:56 -08:00
db_impl_files.cc Let DBSecondary close files after catch up (#6114) 2019-12-02 17:45:03 -08:00
db_impl_open.cc Support options.max_open_files = -1 with periodic_compaction_seconds (#6090) 2019-11-26 21:39:56 -08: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 Let DBSecondary close files after catch up (#6114) 2019-12-02 17:45:03 -08:00
db_impl_secondary.h Let DBSecondary close files after catch up (#6114) 2019-12-02 17:45:03 -08:00
db_impl_write.cc wait pending memtable writes on file ingestion or compact range (#6113) 2019-12-12 14:08:02 -08:00
db_impl.cc wait pending memtable writes on file ingestion or compact range (#6113) 2019-12-12 14:08:02 -08:00
db_impl.h wait pending memtable writes on file ingestion or compact range (#6113) 2019-12-12 14:08:02 -08:00
db_secondary_test.cc Break db_stress_tool.cc to a list of source files (#6134) 2019-12-08 23:51:01 -08:00