]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: don't store/use path_block.{db,wal} from meta
authorSage Weil <sage@redhat.com>
Thu, 7 Jun 2018 17:12:46 +0000 (12:12 -0500)
committerAlfredo Deza <adeza@redhat.com>
Tue, 12 Jun 2018 21:19:44 +0000 (17:19 -0400)
This reverts most of 8d07fa5ad0772b4d979dc10695d230074d1f1e69.

ceph-volume goes to great lengths to ensure that the symlinks in the
osd dir are accurate.  Having these values here is an opportunity to
get them out of sync.  And that can happen very easily if the initial
mkfs was performed using a /dev/sdX device name (which is unstable
across reboots).  Even after ceph-volume corrects the symlink, bluestore
will continue to use the stale device path.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit ef510e43f0ee14b49e99beed9ae8feda6db3429a)

src/os/bluestore/BlueStore.cc

index 17e485a1319325609d034add072c5f22a4cdf43d..d2ed285fcea2a0e1ad0f12728a906f31a70114e1 100644 (file)
@@ -4724,9 +4724,7 @@ int BlueStore::_open_db(bool create, bool to_repair_db)
     string bfn;
     struct stat st;
 
-    if (read_meta("path_block.db", &bfn) < 0) {
-      bfn = path + "/block.db";
-    }
+    bfn = path + "/block.db";
     if (::stat(bfn.c_str(), &st) == 0) {
       r = bluefs->add_block_device(BlueFS::BDEV_DB, bfn,
            create && cct->_conf->bdev_enable_discard);
@@ -4766,10 +4764,8 @@ int BlueStore::_open_db(bool create, bool to_repair_db)
     }
 
     // shared device
-    if (read_meta("path_block", &bfn) < 0) {
-      bfn = path + "/block";
-    }
-     // never trim here
+    bfn = path + "/block";
+    // never trim here
     r = bluefs->add_block_device(bluefs_shared_bdev, bfn, false);
     if (r < 0) {
       derr << __func__ << " add block device(" << bfn << ") returned: " 
@@ -4798,9 +4794,7 @@ int BlueStore::_open_db(bool create, bool to_repair_db)
       bluefs_extents.insert(start, initial);
     }
 
-    if (read_meta("path_block.wal", &bfn) < 0) {
-      bfn = path + "/block.wal";
-    }
+    bfn = path + "/block.wal";
     if (::stat(bfn.c_str(), &st) == 0) {
       r = bluefs->add_block_device(BlueFS::BDEV_WAL, bfn,
        create && cct->_conf->bdev_enable_discard);
@@ -5428,17 +5422,6 @@ int BlueStore::mkfs()
   if (r < 0)
     goto out_close_fsid;
 
-  {
-    string wal_path = cct->_conf->get_val<string>("bluestore_block_wal_path");
-    if (wal_path.size()) {
-      write_meta("path_block.wal", wal_path);
-    }
-    string db_path = cct->_conf->get_val<string>("bluestore_block_db_path");
-    if (db_path.size()) {
-      write_meta("path_block.db", db_path);
-    }
-  }
-
   // choose min_alloc_size
   if (cct->_conf->bluestore_min_alloc_size) {
     min_alloc_size = cct->_conf->bluestore_min_alloc_size;