]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: load stashed map before mkfs monmap 41621/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Thu, 8 Apr 2021 10:12:55 +0000 (12:12 +0200)
committerCory Snyder <csnyder@iland.com>
Tue, 1 Jun 2021 11:48:27 +0000 (07:48 -0400)
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>
(cherry picked from commit cc0b4c77753962717da8a280a585990f7eec3c7b)

src/ceph_mon.cc

index 3463110d1ded3083e64dc3fa616a400c6d039fa6..4ae05567a35d73c523025bdfdd9b5a1d041e6b30 100644 (file)
@@ -109,6 +109,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);