]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: drop messages from before we moved back to boot state
authorSage Weil <sage@newdream.net>
Sat, 15 Jan 2011 00:57:38 +0000 (16:57 -0800)
committerSage Weil <sage@newdream.net>
Mon, 17 Jan 2011 21:18:32 +0000 (13:18 -0800)
We want to make sure we ignore any messages sent to us before we moved
back to the boot state (after being wrongly marked down).  This is only
a problem currently while we are in the BOOT state and waiting to be
re-added to the map, because we may then call _share_map_incoming and
send something on the new rebound messenger to an old peer.  Also assert
that we are !booting there to be sure.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc

index 1fcd5d35e5d391351ba36ef69abc92159dd347f5..d0e9dc6d417a60c1aefb9cec03a03f9d29f4b26f 100644 (file)
@@ -1360,7 +1360,7 @@ void OSD::handle_osd_ping(MOSDPing *m)
     heartbeat_to[from] = m->peer_as_of_epoch;
     heartbeat_inst[from] = m->get_source_inst();
 
-    if (locked && m->map_epoch)
+    if (locked && m->map_epoch && !is_booting())
       _share_map_incoming(m->get_source_inst(), m->map_epoch,
                          (Session*) m->get_connection()->get_priv());
   }
@@ -1370,7 +1370,7 @@ void OSD::handle_osd_ping(MOSDPing *m)
 
     // only take peer stat or share map now if map_lock is uncontended
     if (locked) {
-      if (m->map_epoch)
+      if (m->map_epoch && !is_booting())
        _share_map_incoming(m->get_source_inst(), m->map_epoch,
                            (Session*) m->get_connection()->get_priv());
       take_peer_stat(from, m->peer_stat);  // only with map_lock held!
@@ -1956,6 +1956,8 @@ bool OSD::_share_map_incoming(const entity_inst_t& inst, epoch_t epoch,
   dout(20) << "_share_map_incoming " << inst << " " << epoch << dendl;
   //assert(osd_lock.is_locked());
 
+  assert(!is_booting());
+
   // does client have old map?
   if (inst.name.is_client()) {
     bool sendmap = epoch < osdmap->get_epoch();
@@ -3327,6 +3329,13 @@ bool OSD::require_same_or_newer_map(Message *m, epoch_t epoch)
     }
   }
 
+  // ok, we have at least as new a map as they do.  are we (re)booting?
+  if (is_booting()) {
+    dout(7) << "still in boot state, dropping message " << *m << dendl;
+    m->put();
+    return false;
+  }
+
   return true;
 }