Skip to content

Commit

Permalink
Fix double deletes
Browse files Browse the repository at this point in the history
Summary: While debugging clients compaction issues, I noticed bunch of delete bugs: P16329995. MakeTableName returns sst file with "/" prefix. We also need "/" prefix when we get the files though GetChildren(), so that we can properly dedup the files.

Test Plan: none

Reviewers: sdong, yhchiang, ljin

Reviewed By: ljin

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D23457
  • Loading branch information
igorcanadi committed Sep 25, 2014
1 parent 21ddcf6 commit f7375f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,8 @@ void DBImpl::FindObsoleteFiles(DeletionState& deletion_state,
env_->GetChildren(db_options_.db_paths[path_id].path,
&files); // Ignore errors
for (std::string file : files) {
deletion_state.candidate_files.emplace_back(file, path_id);
// TODO(icanadi) clean up this mess to avoid having one-off "/" prefixes
deletion_state.candidate_files.emplace_back("/" + file, path_id);
}
}

Expand Down

0 comments on commit f7375f3

Please sign in to comment.