From 033ad5b46c0492134e72a8372e44e3ef1358d2df Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 14 Nov 2016 11:50:23 -0800 Subject: [PATCH] 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 --- src/mon/OSDMonitor.cc | 3 ++- src/osd/OSDMap.h | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f63e440fbc7..3e149fd8dcd 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 4f05dc25669..bfa7a653380 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)); -- 2.47.3