From: Paul Emmerich Date: Fri, 15 Jun 2018 22:45:26 +0000 (+0200) Subject: osd: fix getting osd maps on initial osd startup X-Git-Tag: v14.0.1~1065^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22585%2Fhead;p=ceph.git osd: fix getting osd maps on initial osd startup Commit 89d0c357964ff28b83ac541c4d946f712a7bee47 introduced a check for deleted pools that relies on getting an older osd map that might not be available in some situations on OSDs starting up for the very first time. fixes https://tracker.ceph.com/issues/24423 Signed-off-by: Paul Emmerich --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 591a1b609025..d6596fb36f74 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7328,7 +7328,11 @@ void OSD::handle_osd_map(MOSDMap *m) OSDMapRef lastmap; for (auto& i : added_maps) { if (!lastmap) { - lastmap = get_map(i.first - 1); + if (!(lastmap = service.try_get_map(i.first - 1))) { + dout(10) << __func__ << " can't get previous map " << i.first - 1 + << " probably first start of this osd" << dendl; + continue; + } } assert(lastmap->get_epoch() + 1 == i.second->get_epoch()); for (auto& j : lastmap->get_pools()) {