]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix getting osd maps on initial osd startup 22651/head
authorPaul Emmerich <paul.emmerich@croit.io>
Fri, 15 Jun 2018 22:45:26 +0000 (00:45 +0200)
committerSage Weil <sage@redhat.com>
Wed, 20 Jun 2018 20:08:43 +0000 (15:08 -0500)
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 <paul.emmerich@croit.io>
(cherry picked from commit 02180f644094d520d5763afa0e76403591a90b9b)

src/osd/OSD.cc

index a6cf1883603ca20987f36ebc8b55504b18932591..c95c52bb47496334ba9ca47d9ad2a6eb22b39143 100644 (file)
@@ -7358,7 +7358,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()) {