Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BackupEngine::Open gives IOError #921

Closed
shrechak opened this issue Jan 6, 2016 · 2 comments
Closed

BackupEngine::Open gives IOError #921

shrechak opened this issue Jan 6, 2016 · 2 comments

Comments

@shrechak
Copy link

shrechak commented Jan 6, 2016

Pasting my sample code below:

include "rocksdb/db.h"

include "rocksdb/utilities/backupable_db.h"

include

using namespace rocksdb;

int main() {

Options options;
options.create_if_missing = true;
DB* db;
DB::Open(options, "/tmp/rocksdb", &db);
db->Put(WriteOptions(), "key1", "value");
BackupEngine* backup_engine;
Status s = BackupEngine::Open(Env::Default(), BackupableDBOptions("/tmp/rocksdb_backup",nullptr,false,nullptr,false,true,true,0,0) , &backup_engine);
std::cout << s.ToString() << std::endl;
backup_engine->CreateNewBackup(db);
delete db;
delete backup_engine;
}

I specify the value for "share_table_files" as "false", and "destroy_old_data" as "true" - i do not want incremental backups and all the older backups should be deleted. However this gives the following error(when I run the above code):

IO error: /tmp/rocksdb_backup/shared/: No such file or directory
Segmentation fault (core dumped)

I suspect we are checking for the "/shared/" folder by default in GarbageCollect() - {which is being called by Initialize}, even when we can provide an option where the shared folder does not get created. The line is :

auto s = backup_env_->GetChildren(GetAbsolutePath(GetSharedFileRel()),

@igorcanadi
Copy link
Collaborator

Thanks for the great error report, this was likely caused by 8a9fca2. I'm investigating and will submit the fix.

@igorcanadi
Copy link
Collaborator

igorcanadi added a commit that referenced this issue Jan 6, 2016
Summary:
See a bug report here: #921
The fix is to not check the shared/ directory if share_table_files is false. We could also check FileExists() before GetChildren(), but that will add extra latency when Env is Hdfs :(

Test Plan: added a unit test

Reviewers: rven, sdong, IslamAbdelRahman, yhchiang, anthony

Reviewed By: anthony

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D52593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants