Skip to content

Commit

Permalink
compute compaction score once for a batch of range file deletes (#316)
Browse files Browse the repository at this point in the history
Signed-off-by: tabokie <[email protected]>

Signed-off-by: tabokie <[email protected]>
  • Loading branch information
tabokie authored Sep 26, 2022
1 parent 6a7472a commit ce0ea61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions db/db_impl/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3859,10 +3859,12 @@ Status DBImpl::DeleteFilesInRanges(ColumnFamilyHandle* column_family,
deleted_files.insert(level_file);
level_file->being_compacted = true;
}
vstorage->ComputeCompactionScore(*cfd->ioptions(),
*cfd->GetLatestMutableCFOptions());
}
}
if (!deleted_files.empty()) {
vstorage->ComputeCompactionScore(*cfd->ioptions(),
*cfd->GetLatestMutableCFOptions());
}
if (edit.GetDeletedFiles().empty()) {
job_context.Clean();
return status;
Expand Down

0 comments on commit ce0ea61

Please sign in to comment.