From f7375f39fd5db29ecdc3d6821a15efedadaa4a66 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Thu, 25 Sep 2014 11:08:16 -0700 Subject: [PATCH] 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 --- db/db_impl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index cb03d7ea6..bd9b222b3 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -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); } }