From: Sage Weil Date: Sun, 23 Jul 2017 14:26:47 +0000 (-0400) Subject: mon/OSDMonitor: remove zeroed new_state updates X-Git-Tag: v12.1.2~148^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a1611c89df519d3ac99e43d018a9524f94de96e2;p=ceph.git 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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 82fd1cfae43..9ab39128cb2 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; {