]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: load stashed map before mkfs monmap 40660/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Thu, 8 Apr 2021 10:12:55 +0000 (12:12 +0200)
committerDan van der Ster <daniel.vanderster@cern.ch>
Thu, 8 Apr 2021 10:12:55 +0000 (12:12 +0200)
After mkfs the store may not yet contain monmap:last_committed but
might be respawning after setting mon_sync:temp_newer_monmap.
Load that stashed map before falling back to the mkfs:monmap.

Fixes: https://tracker.ceph.com/issues/50230
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
src/ceph_mon.cc

index 306d663d33a883d95c7800f4869108dd82b9c766..f2d417ac4657286aa43ef56d4fdd31ea5e8bd95c 100644 (file)
@@ -123,6 +123,14 @@ int obtain_monmap(MonitorDBStore &store, bufferlist &bl)
     }
   }
 
+  if (store.exists("mon_sync", "temp_newer_monmap")) {
+    dout(10) << __func__ << " found temp_newer_monmap" << dendl;
+    int err = store.get("mon_sync", "temp_newer_monmap", bl);
+    ceph_assert(err == 0);
+    ceph_assert(bl.length() > 0);
+    return 0;
+  }
+
   if (store.exists("mkfs", "monmap")) {
     dout(10) << __func__ << " found mkfs monmap" << dendl;
     int err = store.get("mkfs", "monmap", bl);