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
This commit is contained in:
Andrew Kryczka 2016-12-12 13:18:38 -08:00 committed by Facebook Github Bot
parent f0c509e2c8
commit 243975d5da
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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