]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/RocksDBStore: rocksdb_separate_wal_dir option
authorSage Weil <sage@redhat.com>
Thu, 10 Dec 2015 21:31:18 +0000 (16:31 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:06:54 +0000 (13:06 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/kv/RocksDBStore.cc

index 04dc79aadcaee0d3a8f4fa3791acf37f14803551..0b32947140854a88344476b8c66eaebbe9d1a3a6 100644 (file)
@@ -775,6 +775,7 @@ OPTION(kinetic_hmac_key, OPT_STR, "asdfasdf") // kinetic key to authenticate wit
 OPTION(kinetic_use_ssl, OPT_BOOL, false) // whether to secure kinetic traffic with TLS
 
 
+OPTION(rocksdb_separate_wal_dir, OPT_BOOL, false) // use $path.wal for wal
 OPTION(rocksdb_log_to_ceph_log, OPT_BOOL, true)  // log to ceph log
 // rocksdb options that will be used for keyvaluestore(if backend is rocksdb)
 OPTION(keyvaluestore_rocksdb_options, OPT_STR, "")
index f2fde937acf69bd0d1b4badd71aed9a51827adc1..dd604018c6ad688dccf22ad199ae2ea532b82bf7 100644 (file)
@@ -165,22 +165,6 @@ int RocksDBStore::create_and_open(ostream &out)
       return r;
     }
   }
-
-  // create tertiary paths
-  string wal_path = path + ".wal";
-  struct stat st;
-  int r = ::stat(wal_path.c_str(), &st);
-  if (r < 0)
-    r = -errno;
-  if (r == -ENOENT) {
-    unsigned slashoff = path.rfind('/');
-    string target = path.substr(slashoff + 1);
-    r = ::symlink(target.c_str(), wal_path.c_str());
-    if (r < 0) {
-      out << "failed to symlink " << wal_path << " to " << target;
-      return -errno;
-    }
-  }
   return do_open(out, true);
 }
 
@@ -194,7 +178,9 @@ int RocksDBStore::do_open(ostream &out, bool create_if_missing)
     return -EINVAL;
   }
   opt.create_if_missing = create_if_missing;
-  opt.wal_dir = path + ".wal";
+  if (g_conf->rocksdb_separate_wal_dir) {
+    opt.wal_dir = path + ".wal";
+  }
 
   if (g_conf->rocksdb_log_to_ceph_log) {
     opt.info_log.reset(new CephRocksdbLogger(g_ceph_context));