Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jowlyzhang committed Oct 16, 2023
1 parent 36412ea commit 750f61c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/db_impl/db_impl_files.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ Status DBImpl::EnableFileDeletions(bool force) {

int DBImpl::EnableFileDeletionsWithLock(int count) {
mutex_.AssertHeld();
disable_delete_obsolete_files_ -= count;
// In case others have called EnableFileDeletions(true /* force */) in between
disable_delete_obsolete_files_ =
std::max(0, disable_delete_obsolete_files_ - count);
return disable_delete_obsolete_files_;
}

Expand Down

0 comments on commit 750f61c

Please sign in to comment.