]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: only reject MOSDBoot based on up_from if inst matches 12003/head
authorSamuel Just <sjust@redhat.com>
Mon, 14 Nov 2016 19:50:23 +0000 (11:50 -0800)
committerSamuel Just <sjust@redhat.com>
Mon, 14 Nov 2016 19:50:23 +0000 (11:50 -0800)
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>
src/mon/OSDMonitor.cc
src/osd/OSDMap.h

index f63e440fbc7b6900283e89570f73c5722206bf5f..3e149fd8dcd7ae6dde41b7d4419dba8d4401043b 100644 (file)
@@ -2119,7 +2119,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 4f05dc256693bf0b64cd3f73d5d18c586c2a3c28..bfa7a6533807d0aff0757c299f5f8d054d67093b 100644 (file)
@@ -481,9 +481,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));