94265234de
Summary: Delete triggered compaction in universal compaction mode was causing a corruption when scheduled in parallel with other compactions. 1. When num_levels = 1, a file marked for compaction may be picked along with all older files in L0, without checking if any of them are already being compaction. This can cause unpredictable results like resurrection of older versions of keys or deleted keys. 2. When num_levels > 1, a delete triggered compaction would not get scheduled if it overlaps with a running regular compaction. However, the reverse is not true. This is due to the fact that in ```UniversalCompactionBuilder::CalculateSortedRuns```, it assumes that entire sorted runs are picked for compaction and only checks the first file in a sorted run to determine conflicts. This is violated by a delete triggered compaction as it works on a subset of a sorted run. Fix the bug for num_levels > 1, and disable the feature for now when num_levels = 1. After disabling this feature, files would still get marked for compaction, but no compaction would get scheduled. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6799 Reviewed By: pdillinger Differential Revision: D21431286 Pulled By: anand1976 fbshipit-source-id: ae9f0bdb1d6ae2f10284847db731c23f43af164a |
||
---|---|---|
.. | ||
compaction_iteration_stats.h | ||
compaction_iterator_test.cc | ||
compaction_iterator.cc | ||
compaction_iterator.h | ||
compaction_job_stats_test.cc | ||
compaction_job_test.cc | ||
compaction_job.cc | ||
compaction_job.h | ||
compaction_picker_fifo.cc | ||
compaction_picker_fifo.h | ||
compaction_picker_level.cc | ||
compaction_picker_level.h | ||
compaction_picker_test.cc | ||
compaction_picker_universal.cc | ||
compaction_picker_universal.h | ||
compaction_picker.cc | ||
compaction_picker.h | ||
compaction.cc | ||
compaction.h |