From 6651e514087fa822c728fffc225e0269c59be959 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 7 Apr 2016 19:00:26 -0400 Subject: [PATCH] os/bluestore: fix shortened bluefs paths in env mirror case If we are mirroring the rocksdb env, don't shorten the paths. Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 451262dbb548..553bf108fb5d 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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) -- 2.47.3