Skip to content

Commit f7375f3

Browse files
committed
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
1 parent 21ddcf6 commit f7375f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

db/db_impl.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,8 @@ void DBImpl::FindObsoleteFiles(DeletionState& deletion_state,
590590
env_->GetChildren(db_options_.db_paths[path_id].path,
591591
&files); // Ignore errors
592592
for (std::string file : files) {
593-
deletion_state.candidate_files.emplace_back(file, path_id);
593+
// TODO(icanadi) clean up this mess to avoid having one-off "/" prefixes
594+
deletion_state.candidate_files.emplace_back("/" + file, path_id);
594595
}
595596
}
596597

0 commit comments

Comments
 (0)