Fix double deletes

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
main
Igor Canadi 10 years ago
parent 21ddcf6e4f
commit f7375f39fd
  1. 3
      db/db_impl.cc

@ -590,7 +590,8 @@ void DBImpl::FindObsoleteFiles(DeletionState& deletion_state,
env_->GetChildren(db_options_.db_paths[path_id].path, env_->GetChildren(db_options_.db_paths[path_id].path,
&files); // Ignore errors &files); // Ignore errors
for (std::string file : files) { 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);
} }
} }

Loading…
Cancel
Save