Fix assertion in universal compaction periodic compaction (#6000)

Summary:
We recently added periodic compaction to universal compaction. An old assertion that we can't onlyl compact the last sorted run triggered. However, with periodic compaction, it is possible that we only compact the last sorted run, so the assertion now became stricter than needed. Relaxing this assertion.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6000

Test Plan: This should be a low risk change. Will observe whether stress test will pass after it.

Differential Revision: D18285396

fbshipit-source-id: 9a6863debdf104c40a7f6c46ab62d84cdf5d8592
main
sdong 5 years ago committed by Facebook Github Bot
parent e4e1d35cc2
commit 0d91a981e9
  1. 2
      db/compaction/compaction_picker_universal.cc

@ -965,7 +965,7 @@ Compaction* UniversalCompactionBuilder::PickDeleteTriggeredCompaction() {
Compaction* UniversalCompactionBuilder::PickCompactionToOldest(
size_t start_index, CompactionReason compaction_reason) {
assert(start_index < sorted_runs_.size() - 1);
assert(start_index < sorted_runs_.size());
// Estimate total file size
uint64_t estimated_total_size = 0;

Loading…
Cancel
Save