Dump options in backupable DB

Summary: We should dump options in backupable DB log, just like with to with RocksDB. This will aid debugging.

Test Plan: checked the log

Reviewers: ljin

Reviewed By: ljin

CC: leveldb

Differential Revision: https://reviews.facebook.net/D16719
main
Igor Canadi 11 years ago
parent 66da467983
commit b04c75d244
  1. 2
      include/utilities/backupable_db.h
  2. 11
      utilities/backupable/backupable_db.cc

@ -55,6 +55,8 @@ struct BackupableDBOptions {
// Default: false
bool destroy_old_data;
void Dump(Logger* logger) const;
explicit BackupableDBOptions(const std::string& _backup_dir,
Env* _backup_env = nullptr,
bool _share_table_files = true,

@ -26,6 +26,15 @@
namespace rocksdb {
void BackupableDBOptions::Dump(Logger* logger) const {
Log(logger, " Options.backup_dir: %s", backup_dir.c_str());
Log(logger, " Options.backup_env: %p", backup_env);
Log(logger, "Options.share_table_files: %d", share_table_files);
Log(logger, " Options.info_log: %p", info_log);
Log(logger, " Options.sync: %d", sync);
Log(logger, " Options.destroy_old_data: %d", destroy_old_data);
}
// -------- BackupEngineImpl class ---------
class BackupEngineImpl : public BackupEngine {
public:
@ -205,6 +214,8 @@ BackupEngineImpl::BackupEngineImpl(Env* db_env,
backup_env_(options.backup_env != nullptr ? options.backup_env
: db_env_) {
options_.Dump(options_.info_log);
// create all the dirs we need
backup_env_->CreateDirIfMissing(GetAbsolutePath());
backup_env_->NewDirectory(GetAbsolutePath(), &backup_directory_);

Loading…
Cancel
Save