rocksdb/utilities/transactions
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
..
optimistic_transaction.cc Organizing rocksdb/db directory 2019-05-31 11:57:01 -07:00
optimistic_transaction.h Extend Transaction::GetForUpdate with do_validate (#4680) 2018-12-06 17:49:00 -08:00
optimistic_transaction_db_impl.cc Refactor trimming logic for immutable memtables (#5022) 2019-08-23 13:55:34 -07:00
optimistic_transaction_db_impl.h Make Optimistic Tx database stackable 2018-04-03 15:28:40 -07:00
optimistic_transaction_test.cc Refactor trimming logic for immutable memtables (#5022) 2019-08-23 13:55:34 -07:00
pessimistic_transaction.cc WritePrepared: reduce prepared_mutex_ overhead (#5420) 2019-06-10 11:53:31 -07:00
pessimistic_transaction.h WritePrepared: snapshot should be larger than max_evicted_seq_ (#4886) 2019-01-15 18:11:52 -08:00
pessimistic_transaction_db.cc Refactor trimming logic for immutable memtables (#5022) 2019-08-23 13:55:34 -07:00
pessimistic_transaction_db.h WritePrepared: skip_concurrency_control option (#5330) 2019-05-28 16:29:45 -07:00
snapshot_checker.cc WriteUnPrepared: less virtual in iterator callback (#5049) 2019-04-02 14:47:16 -07:00
transaction_base.cc WriteUnPrepared: savepoint support (#5627) 2019-07-31 13:39:39 -07:00
transaction_base.h WriteUnPrepared: savepoint support (#5627) 2019-07-31 13:39:39 -07:00
transaction_db_mutex_impl.cc Apply modernize-use-override (2nd iteration) 2019-02-14 14:41:36 -08:00
transaction_db_mutex_impl.h Change RocksDB License 2017-07-15 16:11:23 -07:00
transaction_lock_mgr.cc simplify include directive involving inttypes (#5402) 2019-06-06 13:56:07 -07:00
transaction_lock_mgr.h Improve transaction lock details (#5193) 2019-04-15 10:44:03 -07:00
transaction_test.cc Refactor trimming logic for immutable memtables (#5022) 2019-08-23 13:55:34 -07:00
transaction_test.h Fix double deletion in transaction_test (#5700) 2019-08-13 21:54:55 -07:00
transaction_util.cc Refactor trimming logic for immutable memtables (#5022) 2019-08-23 13:55:34 -07:00
transaction_util.h Fix PopSavePoint to merge info into the previous savepoint (#5628) 2019-07-26 11:39:30 -07:00
write_prepared_transaction_test.cc WriteUnPrepared: increase test coverage in transaction_test (#5658) 2019-08-12 12:16:04 -07:00
write_prepared_txn.cc New API to get all merge operands for a Key (#5604) 2019-08-06 14:26:44 -07:00
write_prepared_txn.h WriteUnPrepared: Use WriteUnpreparedTxnReadCallback for MultiGet (#5634) 2019-07-29 17:56:13 -07:00
write_prepared_txn_db.cc WritePrepared: Fix SmallestUnCommittedSeq bug (#5683) 2019-08-09 16:40:00 -07:00
write_prepared_txn_db.h WritePrepared: Fix SmallestUnCommittedSeq bug (#5683) 2019-08-09 16:40:00 -07:00
write_unprepared_transaction_test.cc WriteUnPrepared: Fix bug in savepoints (#5703) 2019-08-14 16:15:46 -07:00
write_unprepared_txn.cc WriteUnPrepared: Fix bug in savepoints (#5703) 2019-08-14 16:15:46 -07:00
write_unprepared_txn.h WriteUnPrepared: support iterating while writing to transaction (#5699) 2019-08-14 14:28:53 -07:00
write_unprepared_txn_db.cc New API to get all merge operands for a Key (#5604) 2019-08-06 14:26:44 -07:00
write_unprepared_txn_db.h WriteUnPrepared: use tracked_keys_ to track keys needed for rollback (#5562) 2019-07-16 15:24:56 -07:00