Skip to content

Commit

Permalink
Compaction: Restore SetupForCompaction functionality (#788)
Browse files Browse the repository at this point in the history
In facebook/rocksdb#11658, files are no longer controlled by the access_hint_on_compaction_start flag by removing the content of SetupForCompaction.
However, this leads to degradation in compaction read speed when combined with compaction_readahead_size since once a file is opened, in linux, it is hinted with POSIX_FADV_RANDOM.

See #787 for full details.

Add back the default hint to avoid degradation in this scenario.
  • Loading branch information
Yuval-Ariel authored Dec 31, 2023
1 parent 7d81aed commit 830754f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Based on RocksDB 8.6.7
* Stall deadlock consists small cfs (#637).
* Proactive Flushes: Fix a race in the ShouldInitiateAnotherFlushMemOnly that may cause the method to return an incorrect answer (#758).
* Fix CI failure after changing compation_readahead_size default to 0 (#794).
* Compaction: Restore SetupForCompaction functionality. Specifically, hint POSIX_FADV_NORMAL for compaction input files.See https://github.com/speedb-io/speedb/issues/787 for full details.

### Miscellaneous
* Remove leftover references to ROCKSDB_LITE (#755).
Expand Down
4 changes: 3 additions & 1 deletion table/block_based/block_based_table_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,9 @@ Status BlockBasedTable::PrefetchIndexAndFilterBlocks(
return s;
}

void BlockBasedTable::SetupForCompaction() {}
void BlockBasedTable::SetupForCompaction() {
rep_->file->file()->Hint(FSRandomAccessFile::kNormal);
}

TablePinningPolicy* BlockBasedTable::GetPinningPolicy() const {
return rep_->table_options.pinning_policy.get();
Expand Down

0 comments on commit 830754f

Please sign in to comment.