6059bdf86a
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 |
||
---|---|---|
.. | ||
utilities | ||
c.h | ||
cache.h | ||
compaction_filter.h | ||
comparator.h | ||
db.h | ||
env.h | ||
experimental.h | ||
filter_policy.h | ||
flush_block_policy.h | ||
immutable_options.h | ||
iostats_context.h | ||
iterator.h | ||
ldb_tool.h | ||
listener.h | ||
memtablerep.h | ||
merge_operator.h | ||
metadata.h | ||
options.h | ||
perf_context.h | ||
rate_limiter.h | ||
slice_transform.h | ||
slice.h | ||
sst_dump_tool.h | ||
statistics.h | ||
status.h | ||
table_properties.h | ||
table.h | ||
thread_status.h | ||
transaction_log.h | ||
types.h | ||
universal_compaction.h | ||
version.h | ||
write_batch_base.h | ||
write_batch.h |