]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: await_reserved_maps() prior to calling mark_down
authorGreg Farnum <greg@inktank.com>
Fri, 27 Jun 2014 21:59:23 +0000 (14:59 -0700)
committerGreg Farnum <greg@inktank.com>
Tue, 1 Jul 2014 04:51:10 +0000 (21:51 -0700)
send_message_osd_cluster() et al are *trying* to protect their Connection
lookups (and not re-open zapped Connections) via map reservations, but
that only works if we know that we haven't already called mark_down() on
the entities they might be looking up. So we need to await_reserved_maps
before we do any mark_down calls.
Since the waiting might take some time (fast dispatch in progress), only do
so if we are actually going to mark somebody down.

Fixes: #8512
Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/osd/OSD.cc

index d3b496f69a6c9bada7fd4f1f8338175a75750f80..ce4cd6e1042c5fd980c3cff09184786d2025b2f1 100644 (file)
@@ -5944,12 +5944,17 @@ void OSD::handle_osd_map(MOSDMap *m)
     service.pre_publish_map(newmap);
 
     // kill connections to newly down osds
+    bool waited_for_reservations = false;
     set<int> old;
     osdmap->get_all_osds(old);
     for (set<int>::iterator p = old.begin(); p != old.end(); ++p) {
       if (*p != whoami &&
          osdmap->have_inst(*p) &&                        // in old map
          (!newmap->exists(*p) || !newmap->is_up(*p))) {  // but not the new one
+        if (!waited_for_reservations) {
+          service.await_reserved_maps();
+          waited_for_reservations = true;
+        }
        note_down_osd(*p);
       }
     }