Skip to content

Commit

Permalink
Compaction: Restore SetupForCompaction functionality
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 committed Dec 25, 2023
1 parent 5e356db commit e931c5c
Showing 1 changed file with 3 additions and 1 deletion.
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 e931c5c

Please sign in to comment.