Report error of GetChildren (#7459)

Summary:
As title

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7459

Test Plan: make check

Reviewed By: anand1976

Differential Revision: D23999393

Pulled By: riversand963

fbshipit-source-id: 09df8e1637f4df3616c63ee314de397b35be4e4a
main
Yanqin Jin 4 years ago committed by Facebook GitHub Bot
parent 12ede5ed7c
commit 07dc955a1f
  1. 13
      db/db_impl/db_impl_files.cc

@ -762,10 +762,13 @@ Status DBImpl::FinishBestEffortsRecovery() {
uint64_t next_file_number = versions_->current_next_file_number();
uint64_t largest_file_number = next_file_number;
std::set<std::string> files_to_delete;
Status s;
for (const auto& path : paths) {
std::vector<std::string> files;
// Should we handle it?
env_->GetChildren(path, &files).PermitUncheckedError();
s = env_->GetChildren(path, &files);
if (!s.ok()) {
break;
}
for (const auto& fname : files) {
uint64_t number = 0;
FileType type;
@ -781,6 +784,10 @@ Status DBImpl::FinishBestEffortsRecovery() {
}
}
}
if (!s.ok()) {
return s;
}
if (largest_file_number > next_file_number) {
versions_->next_file_number_.store(largest_file_number + 1);
}
@ -792,7 +799,7 @@ Status DBImpl::FinishBestEffortsRecovery() {
assert(default_cfd);
// Even if new_descriptor_log is false, we will still switch to a new
// MANIFEST and update CURRENT file, since this is in recovery.
Status s = versions_->LogAndApply(
s = versions_->LogAndApply(
default_cfd, *default_cfd->GetLatestMutableCFOptions(), &edit, &mutex_,
directories_.GetDbDir(), /*new_descriptor_log*/ false);
if (!s.ok()) {

Loading…
Cancel
Save