]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: only reject MOSDBoot based on up_from if inst matches 12067/head
authorSamuel Just <sjust@redhat.com>
Mon, 14 Nov 2016 19:50:23 +0000 (11:50 -0800)
committersmithfarm <ncutler@suse.com>
Fri, 2 Dec 2016 19:22:17 +0000 (20:22 +0100)
If the osd actually restarts, there is no guarrantee that the epoch will
advance past up_from.  If the inst is different, it can't really be a
dup.  At worst, it might be a queued MOSDBoot from a previous inst, but
in that case, the real inst would see itself marked up, and then back
down causing it to try booting again.

Fixes: http://tracker.ceph.com/issues/17899
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 033ad5b46c0492134e72a8372e44e3ef1358d2df)

src/mon/OSDMonitor.cc
src/osd/OSDMap.h

index d4408edd2eb8a14aaf242a59f26f061aacfffd5c..e4989b02ff6008fc4eecc04b0bec1cef615ca84a 100644 (file)
@@ -2042,7 +2042,8 @@ bool OSDMonitor::preprocess_boot(MonOpRequestRef op)
   }
 
   if (osdmap.exists(from) &&
-      osdmap.get_info(from).up_from > m->version) {
+      osdmap.get_info(from).up_from > m->version &&
+      osdmap.get_most_recent_inst(from) == m->get_orig_source_inst()) {
     dout(7) << "prepare_boot msg from before last up_from, ignoring" << dendl;
     send_latest(op, m->sb.current_epoch+1);
     return true;
index affd4c3c1b869ebcf9a1e2c885bae0315bd1c2ef..602b991bc92f767a58a0fffc0bb9fa6f5f9119cf 100644 (file)
@@ -488,9 +488,13 @@ public:
     assert(exists(osd));
     return osd_addrs->hb_front_addr[osd] ? *osd_addrs->hb_front_addr[osd] : osd_addrs->blank;
   }
+  entity_inst_t get_most_recent_inst(int osd) const {
+    assert(exists(osd));
+    return entity_inst_t(entity_name_t::OSD(osd), get_addr(osd));
+  }
   entity_inst_t get_inst(int osd) const {
     assert(is_up(osd));
-    return entity_inst_t(entity_name_t::OSD(osd), get_addr(osd));
+    return get_most_recent_inst(osd);
   }
   entity_inst_t get_cluster_inst(int osd) const {
     assert(is_up(osd));