Bottommost level-based compactions in bottom-pri pool

This commit is contained in:
Andrew Kryczka 2018-05-10 12:10:30 -07:00
parent 072ae671a7
commit 6d49b4a5d3
2 changed files with 5 additions and 6 deletions

View file

@ -14,6 +14,7 @@
* Add DB properties "rocksdb.block-cache-capacity", "rocksdb.block-cache-usage", "rocksdb.block-cache-pinned-usage" to show block cache usage. * Add DB properties "rocksdb.block-cache-capacity", "rocksdb.block-cache-usage", "rocksdb.block-cache-pinned-usage" to show block cache usage.
* Add `Env::LowerThreadPoolCPUPriority(Priority)` method, which lowers the CPU priority of background (esp. compaction) threads to minimize interference with foreground tasks. * Add `Env::LowerThreadPoolCPUPriority(Priority)` method, which lowers the CPU priority of background (esp. compaction) threads to minimize interference with foreground tasks.
* Fsync parent directory after deleting a file in delete scheduler. * Fsync parent directory after deleting a file in delete scheduler.
* In level-based compaction, if bottom-pri thread pool was setup via `Env::SetBackgroundThreads()`, compactions to the bottom level will be delegated to that thread pool.
### Bug Fixes ### Bug Fixes
* Fsync after writing global seq number to the ingestion file in ExternalSstFileIngestionJob. * Fsync after writing global seq number to the ingestion file in ExternalSstFileIngestionJob.

View file

@ -1866,9 +1866,7 @@ Status DBImpl::BackgroundCompaction(bool* made_progress,
// Clear Instrument // Clear Instrument
ThreadStatusUtil::ResetThreadStatus(); ThreadStatusUtil::ResetThreadStatus();
} else if (c->column_family_data()->ioptions()->compaction_style == } else if (!is_prepicked && c->output_level() > 0 &&
kCompactionStyleUniversal &&
!is_prepicked && c->output_level() > 0 &&
c->output_level() == c->output_level() ==
c->column_family_data() c->column_family_data()
->current() ->current()
@ -1876,9 +1874,9 @@ Status DBImpl::BackgroundCompaction(bool* made_progress,
->MaxOutputLevel( ->MaxOutputLevel(
immutable_db_options_.allow_ingest_behind) && immutable_db_options_.allow_ingest_behind) &&
env_->GetBackgroundThreads(Env::Priority::BOTTOM) > 0) { env_->GetBackgroundThreads(Env::Priority::BOTTOM) > 0) {
// Forward universal compactions involving last level to the bottom pool // Forward compactions involving last level to the bottom pool if it exists,
// if it exists, such that long-running compactions can't block short- // such that compactions unlikely to contribute to write stalls can be
// lived ones, like L0->L0s. // delayed or deprioritized.
TEST_SYNC_POINT("DBImpl::BackgroundCompaction:ForwardToBottomPriPool"); TEST_SYNC_POINT("DBImpl::BackgroundCompaction:ForwardToBottomPriPool");
CompactionArg* ca = new CompactionArg; CompactionArg* ca = new CompactionArg;
ca->db = this; ca->db = this;