From a1611c89df519d3ac99e43d018a9524f94de96e2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 23 Jul 2017 10:26:47 -0400 Subject: [PATCH] mon/OSDMonitor: remove zeroed new_state updates These are interpreted as CEPH_OSD_UP in apply_incremental for legacy reasons--we don't want them! Fixes: http://tracker.ceph.com/issues/20751 Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 82fd1cfae438..9ab39128cb29 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -942,6 +942,18 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) } mapping_job.reset(); + // ensure we don't have blank new_state updates. these are interrpeted as + // CEPH_OSD_UP (and almost certainly not what we want!). + auto p = pending_inc.new_state.begin(); + while (p != pending_inc.new_state.end()) { + if (p->second == 0) { + dout(10) << "new_state for osd." << p->first << " is 0, removing" << dendl; + p = pending_inc.new_state.erase(p); + } else { + ++p; + } + } + bufferlist bl; { -- 2.47.3