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>
});
}
-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) {
uuid_d AlienStore::get_fsid() const
{
logger().debug("{}", __func__);
- return osd_fsid;
+ return store->get_fsid();
}
seastar::future<store_statfs_t> AlienStore::stat() const
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;