From: Kefu Chai Date: Sat, 25 Jul 2020 09:13:41 +0000 (+0800) Subject: crimson/os/alienstore: always use fsid in bluestore X-Git-Tag: v16.1.0~1619^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=176fc9f075a8554cbb0fc535a08ac5733c8bcd5c;p=ceph.git crimson/os/alienstore: always use fsid in bluestore 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 --- diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index 66a350e03752..7ce7af21f979 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -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 AlienStore::stat() const diff --git a/src/crimson/os/alienstore/alien_store.h b/src/crimson/os/alienstore/alien_store.h index 79514cc488d1..c9ecfdf4e316 100644 --- a/src/crimson/os/alienstore/alien_store.h +++ b/src/crimson/os/alienstore/alien_store.h @@ -117,7 +117,6 @@ private: mutable std::unique_ptr tp; const std::string path; uint64_t used_bytes = 0; - uuid_d osd_fsid; std::unique_ptr store; std::unique_ptr cct; seastar::gate transaction_gate;