1
0
mirror of https://github.com/google/leveldb.git synced 2025-04-15 13:20:37 +08:00
This commit is contained in:
Honore Vasconcelos 2025-03-12 12:11:50 +00:00 committed by GitHub
commit 5fc2bf9c9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -231,12 +231,18 @@ void DBImpl::RemoveObsoleteFiles() {
return;
}
std::vector<std::string> filenames;
// Dealing with many thousand file can make getting children very slow.
// All file numbers are incremental, so any file produced concurrently
// will have same or greater Number.
mutex_.Unlock();
env_->GetChildren(dbname_, &filenames); // Ignoring errors on purpose
mutex_.Lock();
// Make a set of all of the live files
std::set<uint64_t> live = pending_outputs_;
versions_->AddLiveFiles(&live);
std::vector<std::string> filenames;
env_->GetChildren(dbname_, &filenames); // Ignoring errors on purpose
uint64_t number;
FileType type;
std::vector<std::string> files_to_delete;