diff --git a/src/crimson/osd/main.cc b/src/crimson/osd/main.cc index 449f0cc35d6..90b871ed246 100644 --- a/src/crimson/osd/main.cc +++ b/src/crimson/osd/main.cc @@ -137,9 +137,13 @@ int main(int argc, char* argv[]) hb_back_msgr.stop()); }); if (config.count("mkfs")) { - osd.invoke_on(0, &OSD::mkfs, - local_conf().get_val("fsid")) - .then([] { seastar::engine().exit(0); }).get(); + osd.invoke_on( + 0, + &OSD::mkfs, + local_conf().get_val("osd_uuid"), + local_conf().get_val("fsid")).then([] { + seastar::engine().exit(0); + }).get(); } else { osd.invoke_on(0, &OSD::start).get(); } diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 5cfa29766cd..404f3e7b8cd 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -99,16 +99,22 @@ CompatSet get_osd_initial_compat_set() } } -seastar::future<> OSD::mkfs(uuid_d cluster_fsid) +seastar::future<> OSD::mkfs(uuid_d osd_uuid, uuid_d cluster_fsid) { return store->mkfs().then([this] { return store->mount(); - }).then([cluster_fsid, this] { + }).then([cluster_fsid, osd_uuid, this] { superblock.cluster_fsid = cluster_fsid; - superblock.osd_fsid = store->get_fsid(); + superblock.osd_fsid = osd_uuid; superblock.whoami = whoami; superblock.compat_features = get_osd_initial_compat_set(); + logger().info( + "{} writing superblock cluster_fsid {} osd_fsid {}", + __func__, + cluster_fsid, + superblock.osd_fsid); + meta_coll = make_unique( store->create_new_collection(coll_t::meta()), store.get()); ceph::os::Transaction t; diff --git a/src/crimson/osd/osd.h b/src/crimson/osd/osd.h index d1af35b8855..931aa6ea7d6 100644 --- a/src/crimson/osd/osd.h +++ b/src/crimson/osd/osd.h @@ -107,7 +107,7 @@ public: ceph::net::Messenger& hb_back_msgr); ~OSD() override; - seastar::future<> mkfs(uuid_d fsid); + seastar::future<> mkfs(uuid_d osd_uuid, uuid_d cluster_fsid); seastar::future<> start(); seastar::future<> stop();