rocksdb/include/rocksdb
Igor Canadi 6059bdf86a Add experimental API MarkForCompaction()
Summary:
Some Mongo+Rocks datasets in Parse's environment are not doing compactions very frequently. During the quiet period (with no IO), we'd like to schedule compactions so that our reads become faster. Also, aggressively compacting during quiet periods helps when write bursts happen. In addition, we also want to compact files that are containing deleted key ranges (like old oplog keys).

All of this is currently not possible with CompactRange() because it's single-threaded and blocks all other compactions from happening. Running CompactRange() risks an issue of blocking writes because we generate too much Level 0 files before the compaction is over. Stopping writes is very dangerous because they hold transaction locks. We tried running manual compaction once on Mongo+Rocks and everything fell apart.

MarkForCompaction() solves all of those problems. This is very light-weight manual compaction. It is lower priority than automatic compactions, which means it shouldn't interfere with background process keeping the LSM tree clean. However, if no automatic compactions need to be run (or we have extra background threads available), we will start compacting files that are marked for compaction.

Test Plan: added a new unit test

Reviewers: yhchiang, rven, MarkCallaghan, sdong

Reviewed By: sdong

Subscribers: yoshinorim, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D37083
2015-04-17 16:44:45 -07:00
..
utilities Adding another NewFlashcacheAwareEnv function to support pre-opened fd 2015-04-06 16:50:36 -07:00
c.h maint: remove extraneous "const" attribute from return type 2015-02-20 11:07:07 -08:00
cache.h Deprecate removeScanCountLimit in NewLRUCache 2015-03-17 15:04:37 -07:00
compaction_filter.h Add missing include to use std::unique_ptr 2014-08-23 13:02:21 -04:00
comparator.h CompactFiles, EventListener and GetDatabaseMetaData 2014-11-07 14:45:18 -08:00
db.h Formalize the DB properties string definitions. 2015-03-27 14:50:20 -07:00
env.h Fixed clang build in env.h 2015-03-16 19:51:25 -07:00
experimental.h Add experimental API MarkForCompaction() 2015-04-17 16:44:45 -07:00
filter_policy.h Implement full filter for block based table. 2014-09-08 10:37:05 -07:00
flush_block_policy.h move block based table related options BlockBasedTableOptions 2014-08-25 14:22:05 -07:00
immutable_options.h options.level_compaction_dynamic_level_bytes to allow RocksDB to pick size bases of levels dynamically. 2015-03-02 22:40:41 -08:00
iostats_context.h Fix ios compile 2014-08-28 12:46:05 -04:00
iterator.h Add License message to public header files. 2013-11-18 10:21:35 -08:00
ldb_tool.h [RocksDB] allow LDB tool to have customized key formatter 2014-06-23 15:35:40 -07:00
listener.h Add compaction listener. 2015-01-27 14:44:02 -08:00
memtablerep.h Add thread-safety documentation to MemTable and related classes 2015-04-08 21:10:35 -07:00
merge_operator.h Enhance partial merge to support multiple arguments 2014-03-24 17:57:13 -07:00
metadata.h Fixed -WShadow errors in db/db_test.cc and include/rocksdb/metadata.h 2014-11-07 14:57:51 -08:00
options.h Clean up compression logging 2015-04-06 12:50:44 -07:00
perf_context.h Adding stats for the merge and filter operation 2015-03-24 14:42:04 -07:00
rate_limiter.h Enable dynamic changing of rate limiter's bytes_per_second 2015-03-18 15:35:55 -07:00
slice_transform.h Unaddressed comment in previous diff. Change only in code comments. 2015-01-30 16:07:35 -08:00
slice.h Create an abstract interface for write batches 2015-03-17 19:23:08 -07:00
sst_dump_tool.h Dump routine to BlockBasedTableReader 2014-12-23 13:24:07 -08:00
statistics.h Adding stats for the merge and filter operation 2015-03-24 14:42:04 -07:00
status.h CompactFiles, EventListener and GetDatabaseMetaData 2014-11-07 14:45:18 -08:00
table_properties.h A new call back to TablePropertiesCollector to allow users know the entry is add, delete or merge 2015-04-06 10:27:21 -07:00
table.h A new call back to TablePropertiesCollector to allow users know the entry is add, delete or merge 2015-04-06 10:27:21 -07:00
thread_status.h Report elapsed time in micros in ThreadStatus instead of start time. 2015-03-24 11:32:25 -07:00
transaction_log.h Revert "Fix bad merge of D16791 and D16767" 2014-03-12 09:37:43 -07:00
types.h Add License message to public header files. 2013-11-18 10:21:35 -08:00
universal_compaction.h Support Multiple DB paths (without having an interface to expose to users) 2014-07-02 21:14:44 -07:00
version.h New BlockBasedTable version -- better compressed block format 2015-01-14 16:24:24 -08:00
write_batch_base.h Create an abstract interface for write batches 2015-03-17 19:23:08 -07:00
write_batch.h Create an abstract interface for write batches 2015-03-17 19:23:08 -07:00