More accurate error status for BackupEngine::Open

Summary:
Some users are assuming NotFound means the backup does not
exist at the provided path, which is a reasonable assumption. We need to
stop returning NotFound for system errors.

Depends on #1644
Closes https://github.com/facebook/rocksdb/pull/1645

Differential Revision: D4312233

Pulled By: ajkr

fbshipit-source-id: 5343c10
main
Andrew Kryczka 8 years ago committed by Facebook Github Bot
parent f0c509e2c8
commit 243975d5da
  1. 1
      HISTORY.md
  2. 4
      utilities/backupable/backupable_db.cc

@ -3,6 +3,7 @@
### Public API Change
* Support dynamically change `delete_obsolete_files_period_micros` option via SetDBOptions().
* Added EventListener::OnExternalFileIngested which will be called when IngestExternalFile() add a file successfully.
* BackupEngine::Open and BackupEngineReadOnly::Open now always return error statuses matching those of the backup Env.
## 5.0.0 (11/17/2016)
### Public API Change

@ -556,8 +556,10 @@ Status BackupEngineImpl::Initialize() {
std::vector<std::string> backup_meta_files;
{
auto s = backup_env_->GetChildren(GetBackupMetaDir(), &backup_meta_files);
if (!s.ok()) {
if (s.IsNotFound()) {
return Status::NotFound(GetBackupMetaDir() + " is missing");
} else if (!s.ok()) {
return s;
}
}
// create backups_ structure

Loading…
Cancel
Save