From: Samuel Just Date: Mon, 14 Nov 2016 19:50:23 +0000 (-0800) Subject: OSDMonitor: only reject MOSDBoot based on up_from if inst matches X-Git-Tag: v11.1.0~274^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=033ad5b46c0492134e72a8372e44e3ef1358d2df;p=ceph.git OSDMonitor: only reject MOSDBoot based on up_from if inst matches 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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f63e440fbc7b..3e149fd8dcd7 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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; diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index 4f05dc256693..bfa7a6533807 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -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));