Skip to content

Commit

Permalink
disable use of force parameter in EnableFileDeletions() (and remove a…
Browse files Browse the repository at this point in the history
… leftover assert)
  • Loading branch information
matthewvon committed Jul 22, 2024
1 parent 7210d83 commit dc8b133
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion db/db_impl/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ Status DBImpl::ResumeImpl(DBRecoverContext context) {
// clean-up phase MANIFEST writing. We must have also disabled file
// deletions.
assert(!versions_->descriptor_log_);
assert(file_deletion_disabled);
// Since we are trying to recover from MANIFEST write error, we need to
// switch to a new MANIFEST anyway. The old MANIFEST can be corrupted.
// Therefore, force writing a dummy version edit because we do not know
Expand Down
8 changes: 3 additions & 5 deletions db/db_impl/db_impl_files.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@ Status DBImpl::DisableFileDeletionsWithLock() {
return Status::OK();
}

Status DBImpl::EnableFileDeletions(bool force) {
// matthewv - Jul 22, 2024 - disable "force" per rocksdb in later version
Status DBImpl::EnableFileDeletions(bool /*force*/) {
// Job id == 0 means that this is not our background process, but rather
// user thread
JobContext job_context(0);
int saved_counter; // initialize on all paths
{
InstrumentedMutexLock l(&mutex_);
if (force) {
// if force, we need to enable file deletions right away
disable_delete_obsolete_files_ = 0;
} else if (disable_delete_obsolete_files_ > 0) {
if (disable_delete_obsolete_files_ > 0) {
--disable_delete_obsolete_files_;
}
saved_counter = disable_delete_obsolete_files_;
Expand Down

0 comments on commit dc8b133

Please sign in to comment.