From: Dan van der Ster Date: Thu, 8 Apr 2021 10:12:55 +0000 (+0200) Subject: mon: load stashed map before mkfs monmap X-Git-Tag: v15.2.14~59^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9025d018a6241cc4e073cf13cfc7e6b56bffd3cd;p=ceph.git mon: load stashed map before mkfs monmap 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 (cherry picked from commit cc0b4c77753962717da8a280a585990f7eec3c7b) --- diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc index 3463110d1ded3..4ae05567a35d7 100644 --- a/src/ceph_mon.cc +++ b/src/ceph_mon.cc @@ -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);