Compaction limiter miscs (#4795)

Summary:
1. Remove unused API SubtractCompactionTask().
2. Assert outstanding tasks drop to zero in ConcurrentTaskLimiterImpl destructor.
3. Remove GetOutstandingTask() check from manual compaction test, as TEST_WaitForCompact() doesn't synced with 'delete prepicked_compaction' in DBImpl::BGWorkCompaction(), which may make the test flaky.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4795

Differential Revision: D13542183

Pulled By: siying

fbshipit-source-id: 5eb2a47e62efe4126937149aa0df6e243ebefc33
main
Burton Li 6 years ago committed by Facebook Github Bot
parent b1288cdc24
commit 46e3209e0d
  1. 5
      db/db_compaction_test.cc
  2. 3
      db/db_impl.h
  3. 1
      util/concurrent_task_limiter_impl.cc

@ -4053,7 +4053,7 @@ TEST_F(DBCompactionTest, CompactionLimiter) {
dbfull()->TEST_WaitForFlushMemTable(handles_[cf]);
}
dbfull()->TEST_WaitForCompact();
ASSERT_OK(dbfull()->TEST_WaitForCompact());
// Max outstanding compact tasks reached limit
for (auto& ls : limiter_settings) {
@ -4076,8 +4076,7 @@ TEST_F(DBCompactionTest, CompactionLimiter) {
ASSERT_EQ(1, NumTableFilesAtLevel(0, cf_test));
Compact(cf_test, Key(0), Key(keyIndex));
dbfull()->TEST_WaitForCompact();
ASSERT_EQ(0, unique_limiter->GetOutstandingTask());
ASSERT_OK(dbfull()->TEST_WaitForCompact());
}
INSTANTIATE_TEST_CASE_P(DBCompactionTestWithParam, DBCompactionTestWithParam,

@ -1114,9 +1114,6 @@ class DBImpl : public DB {
// Schedule background tasks
void StartTimedTasks();
void SubtractCompactionTask(const std::string& device_name,
LogBuffer* log_buffer);
void PrintStatistics();
// dump rocksdb.stats to LOG

@ -21,6 +21,7 @@ ConcurrentTaskLimiterImpl::ConcurrentTaskLimiterImpl(
}
ConcurrentTaskLimiterImpl::~ConcurrentTaskLimiterImpl() {
assert(outstanding_tasks_ == 0);
}
const std::string& ConcurrentTaskLimiterImpl::GetName() const {

Loading…
Cancel
Save