]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix shortened bluefs paths in env mirror case 8498/head
authorSage Weil <sage@redhat.com>
Thu, 7 Apr 2016 23:00:26 +0000 (19:00 -0400)
committerSage Weil <sage@redhat.com>
Wed, 13 Apr 2016 13:29:16 +0000 (09:29 -0400)
If we are mirroring the rocksdb env, don't shorten the
paths.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 451262dbb548e3e480029eaaa8b445de86a2acc7..553bf108fb5db9967fb79c0a1ce5fee554d489ed 100644 (file)
@@ -1215,24 +1215,6 @@ int BlueStore::_open_db(bool create)
       bluefs_extents.insert(BLUEFS_START, initial);
     }
 
-    // use a short, relative path, if it's bluefs.
-    strcpy(fn, "db");
-
-    if (bluefs_shared_bdev == BlueFS::BDEV_SLOW) {
-      // we have both block.db and block; tell rocksdb!
-      // note: the second (last) size value doesn't really matter
-      char db_paths[PATH_MAX*3];
-      snprintf(
-       db_paths, sizeof(db_paths), "db,%lld db.slow,%lld",
-       (unsigned long long)bluefs->get_block_device_size(BlueFS::BDEV_DB) *
-        95 / 100,
-       (unsigned long long)bluefs->get_block_device_size(BlueFS::BDEV_SLOW) *
-        95 / 100);
-      g_conf->set_val("rocksdb_db_paths", db_paths, false, false);
-      dout(10) << __func__ << " set rocksdb_db_paths to "
-              << g_conf->rocksdb_db_paths << dendl;
-    }
-
     snprintf(bfn, sizeof(bfn), "%s/block.wal", path.c_str());
     if (::stat(bfn, &st) == 0) {
       r = bluefs->add_block_device(BlueFS::BDEV_WAL, bfn);
@@ -1288,6 +1270,23 @@ int BlueStore::_open_db(bool create)
       strcpy(fn, "db");
     }
 
+    if (bluefs_shared_bdev == BlueFS::BDEV_SLOW) {
+      // we have both block.db and block; tell rocksdb!
+      // note: the second (last) size value doesn't really matter
+      char db_paths[PATH_MAX*3];
+      snprintf(
+       db_paths, sizeof(db_paths), "%s,%lld %s.slow,%lld",
+       fn,
+       (unsigned long long)bluefs->get_block_device_size(BlueFS::BDEV_DB) *
+        95 / 100,
+       fn,
+       (unsigned long long)bluefs->get_block_device_size(BlueFS::BDEV_SLOW) *
+        95 / 100);
+      g_conf->set_val("rocksdb_db_paths", db_paths, false, false);
+      dout(10) << __func__ << " set rocksdb_db_paths to "
+              << g_conf->rocksdb_db_paths << dendl;
+    }
+
     if (create) {
       env->CreateDir(fn);
       if (g_conf->rocksdb_separate_wal_dir)