rocksdb/tools
Andrew Kryczka cc01985db0 Introduce bottom-pri thread pool for large universal compactions
Summary:
When we had a single thread pool for compactions, a thread could be busy for a long time (minutes) executing a compaction involving the bottom level. In multi-instance setups, the entire thread pool could be consumed by such bottom-level compactions. Then, top-level compactions (e.g., a few L0 files) would be blocked for a long time ("head-of-line blocking"). Such top-level compactions are critical to prevent compaction stalls as they can quickly reduce number of L0 files / sorted runs.

This diff introduces a bottom-priority queue for universal compactions including the bottom level. This alleviates the head-of-line blocking situation for fast, top-level compactions.

- Added `Env::Priority::BOTTOM` thread pool. This feature is only enabled if user explicitly configures it to have a positive number of threads.
- Changed `ThreadPoolImpl`'s default thread limit from one to zero. This change is invisible to users as we call `IncBackgroundThreadsIfNeeded` on the low-pri/high-pri pools during `DB::Open` with values of at least one. It is necessary, though, for bottom-pri to start with zero threads so the feature is disabled by default.
- Separated `ManualCompaction` into two parts in `PrepickedCompaction`. `PrepickedCompaction` is used for any compaction that's picked outside of its execution thread, either manual or automatic.
- Forward universal compactions involving last level to the bottom pool (worker thread's entry point is `BGWorkBottomCompaction`).
- Track `bg_bottom_compaction_scheduled_` so we can wait for bottom-level compactions to finish. We don't count them against the background jobs limits. So users of this feature will get an extra compaction for free.
Closes https://github.com/facebook/rocksdb/pull/2580

Differential Revision: D5422916

Pulled By: ajkr

fbshipit-source-id: a74bd11f1ea4933df3739b16808bb21fcd512333
2017-08-03 15:43:29 -07:00
..
dump Change RocksDB License 2017-07-15 16:11:23 -07:00
rdb fixed typo 2017-06-05 11:27:34 -07:00
auto_sanity_test.sh AIX and Solaris Sparc Support 2017-04-21 20:48:04 -07:00
benchmark_leveldb.sh Add scripts to run leveldb benchmark 2015-04-27 19:32:56 -07:00
benchmark.sh remove deleted option from benchmark.sh 2017-03-21 12:54:13 -07:00
blob_dump.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
check_format_compatible.sh checkout local branch in check_format_compatible.sh 2017-07-18 10:42:17 -07:00
CMakeLists.txt cmake support for linux and osx (#1358) 2016-09-28 11:53:15 -07:00
db_bench_tool_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
db_bench_tool.cc Introduce bottom-pri thread pool for large universal compactions 2017-08-03 15:43:29 -07:00
db_bench.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
db_crashtest.py db_crashtest.py: remove need for shell 2017-07-14 09:11:03 -07:00
db_repl_stress.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
db_sanity_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
db_stress.cc Revert "CRC32 Power Optimization Changes" 2017-07-26 19:31:36 -07:00
dbench_monitor Added simple monitoring script to monitor overusage of memory in db_bench 2015-02-11 18:40:11 -08:00
Dockerfile adding docker build script and dockerfile 2015-05-22 16:03:39 -07:00
generate_random_db.sh Script to check whether RocksDB can read DB generated by previous releases and vice versa 2015-04-08 16:04:59 -07:00
ldb_cmd_impl.h Change RocksDB License 2017-07-15 16:11:23 -07:00
ldb_cmd_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
ldb_cmd.cc Replace dynamic_cast<> 2017-07-28 16:27:16 -07:00
ldb_test.py Add GetAllKeyVersions API 2017-05-12 15:54:06 -07:00
ldb_tool.cc Revert "comment out unused parameters" 2017-07-21 18:26:26 -07:00
ldb.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
pflag Added simple monitoring script to monitor overusage of memory in db_bench 2015-02-11 18:40:11 -08:00
reduce_levels_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
regression_test.sh fix regression test 2017-07-10 17:17:31 -07:00
rocksdb_dump_test.sh AIX and Solaris Sparc Support 2017-04-21 20:48:04 -07:00
run_flash_bench.sh AIX and Solaris Sparc Support 2017-04-21 20:48:04 -07:00
run_leveldb.sh AIX and Solaris Sparc Support 2017-04-21 20:48:04 -07:00
sample-dump.dmp First version of rocksdb_dump and rocksdb_undump. 2015-06-19 16:24:36 -07:00
sst_dump_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
sst_dump_tool_imp.h Change RocksDB License 2017-07-15 16:11:23 -07:00
sst_dump_tool.cc Replace dynamic_cast<> 2017-07-28 16:27:16 -07:00
sst_dump.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
verify_random_db.sh tools/check_format_compatible.sh to cover option file loading too 2017-04-20 10:26:37 -07:00
write_stress_runner.py Write stress test 2015-10-28 16:15:07 -07:00
write_stress.cc tools/write_stress.cc: Correct "1204" typos. 2017-07-17 11:27:10 -07:00