From ef204df7efac05ed83961783d94ce429f7aa4aac Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 2 Mar 2016 16:26:47 -0800 Subject: [PATCH] Compaction always needs to be removed from level0_compactions_in_progress_ for universal compaction Summary: We always put compaction to level0_compactions_in_progress_ for universal compaction, so we should also remove it. The bug causes assert failure when running manual compaction. Test Plan: TEST_TMPDIR=/dev/shm/ ./db_bench --benchmarks=fillrandom,compact --subcompactions=16 --compaction_style=1 always fails on my host. After the fix, it doesn't fail any more. Reviewers: IslamAbdelRahman, andrewkr, kradhakrishnan, yhchiang Reviewed By: yhchiang Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D55017 --- db/compaction_picker.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/compaction_picker.cc b/db/compaction_picker.cc index dad59a0a3..91b9a2b5a 100644 --- a/db/compaction_picker.cc +++ b/db/compaction_picker.cc @@ -141,7 +141,8 @@ CompactionPicker::~CompactionPicker() {} // Delete this compaction from the list of running compactions. void CompactionPicker::ReleaseCompactionFiles(Compaction* c, Status status) { - if (c->start_level() == 0) { + if (c->start_level() == 0 || + ioptions_.compaction_style == kCompactionStyleUniversal) { level0_compactions_in_progress_.erase(c); } if (!status.ok()) {