]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/alienstore: always use fsid in bluestore
authorKefu Chai <kchai@redhat.com>
Sat, 25 Jul 2020 09:13:41 +0000 (17:13 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 27 Jul 2020 03:29:10 +0000 (11:29 +0800)
alienstore should not be stateful in this perspective, it should proxy
all acccess of fsid to bluestore.

there are couple issues in existing implementation:

* when mkfs, bluestore tries to generate a new osd_fsid if the specified
  one is empty. but we explicitly pass the given uuid down to
  AlienStore::mkfs() so the bluestore can use it. so we should pass it
  down instad of storing it locally.
* when persisting superblock in OSD::mkfs(), superblock.osd_fsid() is
  read from store->get_fsid(), if user specifies an empty uuid, we
  should persist the generated uuid in the superblock.

in this change, all access to fsid is proxied to the underlying
bluestore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/alienstore/alien_store.cc
src/crimson/os/alienstore/alien_store.h

index 66a350e03752d331d343d997507560ce3b878824..7ce7af21f9794c4db92e61461d7f324e015cf21f 100644 (file)
@@ -119,10 +119,10 @@ seastar::future<> AlienStore::umount()
   });
 }
 
-seastar::future<> AlienStore::mkfs(uuid_d new_osd_fsid)
+seastar::future<> AlienStore::mkfs(uuid_d osd_fsid)
 {
   logger().debug("{}", __func__);
-  osd_fsid = new_osd_fsid;
+  store->set_fsid(osd_fsid);
   return tp->submit([this] {
     return store->mkfs();
   }).then([] (int r) {
@@ -405,7 +405,7 @@ AlienStore::read_meta(const std::string& key)
 uuid_d AlienStore::get_fsid() const
 {
   logger().debug("{}", __func__);
-  return osd_fsid;
+  return store->get_fsid();
 }
 
 seastar::future<store_statfs_t> AlienStore::stat() const
index 79514cc488d18c26055db9b9eb51bd938237c93f..c9ecfdf4e316c0eb9981ac2e12e77ad9429e853e 100644 (file)
@@ -117,7 +117,6 @@ private:
   mutable std::unique_ptr<crimson::os::ThreadPool> tp;
   const std::string path;
   uint64_t used_bytes = 0;
-  uuid_d osd_fsid;
   std::unique_ptr<ObjectStore> store;
   std::unique_ptr<CephContext> cct;
   seastar::gate transaction_gate;