]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: load stashed map before mkfs monmap 41762/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>
Tue, 8 Jun 2021 17:55:31 +0000 (19:55 +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>
(cherry picked from commit cc0b4c77753962717da8a280a585990f7eec3c7b)

src/ceph_mon.cc

index 24bfe1b7c74e05dcbd050a3060fb85feaab4f366..61804469f2df7171b39f9dee2bc18ffa58820097 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);