]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: remove zeroed new_state updates
authorSage Weil <sage@redhat.com>
Sun, 23 Jul 2017 14:26:47 +0000 (10:26 -0400)
committerSage Weil <sage@redhat.com>
Mon, 24 Jul 2017 02:03:47 +0000 (22:03 -0400)
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 <sage@redhat.com>
src/mon/OSDMonitor.cc

index 82fd1cfae43821482eb561911a97642d61fe92fb..9ab39128cb2999b4186fe2eb5761a8a3a9189527 100644 (file)
@@ -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;
 
   {