Project

General

Profile

Bug #24661

os/bluestore: don't store/use path_block.{db,wal} from meta

Added by Alfredo Deza almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
% Done:

0%

Source:
Tags:
Backport:
mimic,luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

This reverts most of 8d07fa5.

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.


Related issues

Copied to Ceph - Backport #24749: mimic: os/bluestore: don't store/use path_block.{db,wal} from meta Resolved
Copied to Ceph - Backport #24750: luminous: os/bluestore: don't store/use path_block.{db,wal} from meta Resolved

History

#1 Updated by Alfredo Deza almost 2 years ago

The PR didn't have an issue attached to it.

(merged) Master PR https://github.com/ceph/ceph/pull/22462
(merged) Backport to Mimic https://github.com/ceph/ceph/pull/22477

I was unable to backport to Luminous as it has conflicts I couldn't resolve on the C++ side.

diff --cc src/os/bluestore/BlueStore.cc
index 55a8351e67,9228a9da52..0000000000
--- a/src/os/bluestore/BlueStore.cc
+++ b/src/os/bluestore/BlueStore.cc
@@@ -4557,11 -4725,10 +4557,9 @@@ int BlueStore::_open_db(bool create
      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);
 +      r = bluefs->add_block_device(BlueFS::BDEV_DB, bfn);
        if (r < 0) {
          derr << __func__ << " add block device(" << bfn << ") returned: " 
               << cpp_strerror(r) << dendl;
@@@ -4598,10 -4765,9 +4596,22 @@@
      }

      // shared device
++<<<<<<< HEAD
 +    if (read_meta("path_block", &bfn) < 0) {
 +      bfn = path + "/block";
 +    }
 +    r = bluefs->add_block_device(bluefs_shared_bdev, bfn);
++||||||| parent of ef510e43f0... os/bluestore: don't store/use path_block.{db,wal} from meta
++    if (read_meta("path_block", &bfn) < 0) {
++      bfn = path + "/block";
++    }
++     // never trim here
++    r = bluefs->add_block_device(bluefs_shared_bdev, bfn, false);
++=======
+     bfn = path + "/block";
+     // never trim here
+     r = bluefs->add_block_device(bluefs_shared_bdev, bfn, false);
++>>>>>>> ef510e43f0... os/bluestore: don't store/use path_block.{db,wal} from meta
      if (r < 0) {
        derr << __func__ << " add block device(" << bfn << ") returned: " 
           << cpp_strerror(r) << dendl;
@@@ -4629,11 -4795,10 +4639,9 @@@
        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);
 +      r = bluefs->add_block_device(BlueFS::BDEV_WAL, bfn);
        if (r < 0) {
          derr << __func__ << " add block device(" << bfn << ") returned: " 
             << cpp_strerror(r) << dendl;

#2 Updated by Sage Weil almost 2 years ago

  • Status changed from New to Fix Under Review

#3 Updated by Alfredo Deza almost 2 years ago

  • Status changed from Fix Under Review to Resolved

#4 Updated by Nathan Cutler almost 2 years ago

  • Status changed from Resolved to Pending Backport
  • Backport changed from luminous to mimic,luminous

#5 Updated by Nathan Cutler almost 2 years ago

  • Copied to Backport #24749: mimic: os/bluestore: don't store/use path_block.{db,wal} from meta added

#6 Updated by Nathan Cutler almost 2 years ago

  • Copied to Backport #24750: luminous: os/bluestore: don't store/use path_block.{db,wal} from meta added

#7 Updated by Nathan Cutler almost 2 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF