rocksdb/tools
Zhongyi Xie 2f41ecfe75 Refactor trimming logic for immutable memtables (#5022)
Summary:
MyRocks currently sets `max_write_buffer_number_to_maintain` in order to maintain enough history for transaction conflict checking. The effectiveness of this approach depends on the size of memtables. When memtables are small, it may not keep enough history; when memtables are large, this may consume too much memory.
We are proposing a new way to configure memtable list history: by limiting the memory usage of immutable memtables. The new option is `max_write_buffer_size_to_maintain` and it will take precedence over the old `max_write_buffer_number_to_maintain` if they are both set to non-zero values. The new option accounts for the total memory usage of flushed immutable memtables and mutable memtable. When the total usage exceeds the limit, RocksDB may start dropping immutable memtables (which is also called trimming history), starting from the oldest one.
The semantics of the old option actually works both as an upper bound and lower bound. History trimming will start if number of immutable memtables exceeds the limit, but it will never go below (limit-1) due to history trimming.
In order the mimic the behavior with the new option, history trimming will stop if dropping the next immutable memtable causes the total memory usage go below the size limit. For example, assuming the size limit is set to 64MB, and there are 3 immutable memtables with sizes of 20, 30, 30. Although the total memory usage is 80MB > 64MB, dropping the oldest memtable will reduce the memory usage to 60MB < 64MB, so in this case no memtable will be dropped.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5022

Differential Revision: D14394062

Pulled By: miasantreble

fbshipit-source-id: 60457a509c6af89d0993f988c9b5c2aa9e45f5c5
2019-08-23 13:55:34 -07:00
..
advisor Rules Advisor: some fixes to support fetching stats from ODS (#4223) 2018-08-02 15:42:42 -07:00
block_cache_analyzer Block cache analyzer: Support reading from human readable trace file. (#5679) 2019-08-09 13:13:54 -07:00
dump simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
rdb Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
analyze_txn_stress_test.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
auto_sanity_test.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
benchmark_leveldb.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
benchmark.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
blob_dump.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
check_format_compatible.sh Add more release versions to tools/check_format_compatible.sh (#5518) 2019-06-28 17:41:58 -07:00
CMakeLists.txt cmake support for linux and osx (#1358) 2016-09-28 11:53:15 -07:00
db_bench_tool_test.cc Refactor trimming logic for immutable memtables (#5022) 2019-08-23 13:55:34 -07:00
db_bench_tool.cc Refactor trimming logic for immutable memtables (#5022) 2019-08-23 13:55:34 -07:00
db_bench.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
db_crashtest.py Atomic Flush Crash Test also covers the case that WAL is enabled. (#5729) 2019-08-22 16:32:55 -07:00
db_repl_stress.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
db_sanity_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
db_stress.cc Refactor trimming logic for immutable memtables (#5022) 2019-08-23 13:55:34 -07:00
dbench_monitor Fix /bin/bash shebangs 2017-08-03 15:56:46 -07:00
Dockerfile adding docker build script and dockerfile 2015-05-22 16:03:39 -07:00
generate_random_db.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
ingest_external_sst.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
ldb_cmd_impl.h Add command "list_file_range_deletes" in ldb (#5615) 2019-08-15 17:01:03 -07:00
ldb_cmd_test.cc Add command "list_file_range_deletes" in ldb (#5615) 2019-08-15 17:01:03 -07:00
ldb_cmd.cc Add command "list_file_range_deletes" in ldb (#5615) 2019-08-15 17:01:03 -07:00
ldb_test.py Fix interpreter lines for files with python2-only syntax. 2019-07-09 10:51:37 -07:00
ldb_tool.cc Add command "list_file_range_deletes" in ldb (#5615) 2019-08-15 17:01:03 -07:00
ldb.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
pflag Fix /bin/bash shebangs 2017-08-03 15:56:46 -07:00
reduce_levels_test.cc Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00
regression_test.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
report_lite_binary_size.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
rocksdb_dump_test.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
run_flash_bench.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
run_leveldb.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -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 Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
sst_dump_tool_imp.h tools: use provided options instead of the default (#4839) 2019-01-03 11:23:49 -08:00
sst_dump_tool.cc Do readahead in VerifyChecksum() (#5713) 2019-08-16 16:42:56 -07:00
sst_dump.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
trace_analyzer_test.cc Move util/trace_replay.* to trace_replay/ (#5376) 2019-06-03 13:25:26 -07:00
trace_analyzer_tool.cc replace sprintf with its safe version snprintf (#5475) 2019-06-18 16:42:26 -07:00
trace_analyzer_tool.h Move util/trace_replay.* to trace_replay/ (#5376) 2019-06-03 13:25:26 -07:00
trace_analyzer.cc RocksDB Trace Analyzer (#4091) 2018-08-13 11:44:02 -07:00
verify_random_db.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
write_external_sst.sh Add copyright headers per FB open-source checkup tool. (#5199) 2019-04-18 10:55:01 -07:00
write_stress_runner.py Fix interpreter lines for files with python2-only syntax. 2019-07-09 10:51:37 -07:00
write_stress.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00