]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: use configured ceph-osd uuid in mkfs
authorSamuel Just <sjust@redhat.com>
Thu, 30 May 2019 00:32:03 +0000 (17:32 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 31 May 2019 21:05:44 +0000 (14:05 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/main.cc
src/crimson/osd/osd.cc
src/crimson/osd/osd.h

index 449f0cc35d6a4ca7b21e6a6e1eb74c729d01c1bf..90b871ed246949cfa6cf3c49bf0c623c363c2ba3 100644 (file)
@@ -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<uuid_d>("fsid"))
-            .then([] { seastar::engine().exit(0); }).get();
+          osd.invoke_on(
+           0,
+           &OSD::mkfs,
+           local_conf().get_val<uuid_d>("osd_uuid"),
+           local_conf().get_val<uuid_d>("fsid")).then([] {
+             seastar::engine().exit(0);
+           }).get();
         } else {
           osd.invoke_on(0, &OSD::start).get();
         }
index 5cfa29766cddf7317a52dd4c0e926ab1ead7b1a9..404f3e7b8cda09c7f824f937a08ee3f2dfa88f88 100644 (file)
@@ -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<OSDMeta>(
       store->create_new_collection(coll_t::meta()), store.get());
     ceph::os::Transaction t;
index d1af35b8855aaafcceac6b7992c050d6ad6eeae9..931aa6ea7d693d4b70f6717e57c62df6f75f5863 100644 (file)
@@ -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();