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
This commit is contained in:
parent
b1288cdc24
commit
46e3209e0d
@ -4053,7 +4053,7 @@ TEST_F(DBCompactionTest, CompactionLimiter) {
|
|||||||
dbfull()->TEST_WaitForFlushMemTable(handles_[cf]);
|
dbfull()->TEST_WaitForFlushMemTable(handles_[cf]);
|
||||||
}
|
}
|
||||||
|
|
||||||
dbfull()->TEST_WaitForCompact();
|
ASSERT_OK(dbfull()->TEST_WaitForCompact());
|
||||||
|
|
||||||
// Max outstanding compact tasks reached limit
|
// Max outstanding compact tasks reached limit
|
||||||
for (auto& ls : limiter_settings) {
|
for (auto& ls : limiter_settings) {
|
||||||
@ -4076,8 +4076,7 @@ TEST_F(DBCompactionTest, CompactionLimiter) {
|
|||||||
ASSERT_EQ(1, NumTableFilesAtLevel(0, cf_test));
|
ASSERT_EQ(1, NumTableFilesAtLevel(0, cf_test));
|
||||||
|
|
||||||
Compact(cf_test, Key(0), Key(keyIndex));
|
Compact(cf_test, Key(0), Key(keyIndex));
|
||||||
dbfull()->TEST_WaitForCompact();
|
ASSERT_OK(dbfull()->TEST_WaitForCompact());
|
||||||
ASSERT_EQ(0, unique_limiter->GetOutstandingTask());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(DBCompactionTestWithParam, DBCompactionTestWithParam,
|
INSTANTIATE_TEST_CASE_P(DBCompactionTestWithParam, DBCompactionTestWithParam,
|
||||||
|
@ -1114,9 +1114,6 @@ class DBImpl : public DB {
|
|||||||
// Schedule background tasks
|
// Schedule background tasks
|
||||||
void StartTimedTasks();
|
void StartTimedTasks();
|
||||||
|
|
||||||
void SubtractCompactionTask(const std::string& device_name,
|
|
||||||
LogBuffer* log_buffer);
|
|
||||||
|
|
||||||
void PrintStatistics();
|
void PrintStatistics();
|
||||||
|
|
||||||
// dump rocksdb.stats to LOG
|
// dump rocksdb.stats to LOG
|
||||||
|
@ -21,6 +21,7 @@ ConcurrentTaskLimiterImpl::ConcurrentTaskLimiterImpl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConcurrentTaskLimiterImpl::~ConcurrentTaskLimiterImpl() {
|
ConcurrentTaskLimiterImpl::~ConcurrentTaskLimiterImpl() {
|
||||||
|
assert(outstanding_tasks_ == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& ConcurrentTaskLimiterImpl::GetName() const {
|
const std::string& ConcurrentTaskLimiterImpl::GetName() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user