facebook / facebook/rocksdb

An IO error occurs when doing checkpoint (db_paths, cf_paths not supported for checkpoint+backups)

Open
#8,647 8 comments 0 reactions 1 assignee Claimed by @zaorangyang View on GitHub
bug
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

### Expected behavior
Checkpoint should be executed correctly when db_paths specified
### Actual behavior
It throws a IO error -- "IO error: No such file or directory: while link file to checkpont_dir.tmp/000009.sst: main/000009.sst: No such file or directory"
### Steps to reproduce the behavior
Take a look at the following example:
```
#include "rocksdb/db.h"
#include "rocksdb/utilities/checkpoint.h"
#include

int main() {
rocksdb::DB* db;
rocksdb::Options options;
options.create_if_missing = true;
options.enable_blob_files = true;
options.min_blob_size = 0;
std::string dbname = "main";
options.wal_dir = dbname + "_wal";
options.db_paths.emplace_back(dbname + "_db", std::numeric_limits::max());
rocksdb::Status status = rocksdb::DB::Open(options, dbname, &db);
assert(status.ok());
std::string key = "key1";
std::string value = "value1";
status = db->Put(rocksdb::WriteOptions(), key, value);
assert(status.ok());
rocksdb::FlushOptions flush_opts;
status = db->Flush(flush_opts);
assert(status.ok());
status = db->Get(rocksdb::ReadOptions(), key, &value);
assert(status.ok());

std::string checkpoint_dir = "checkpont_dir";
rocksdb::Checkpoint* checkpoint;
std::cout << "Start Checkpoint" << std::endl;
rocksdb::Checkpoint::Create(db, &checkpoint);
status = checkpoint->CreateCheckpoint(checkpoint_dir);
std::cout << status.ToString() << std::endl;
delete db;
delete checkpoint;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.