]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: set new_last_{up,in}_change
authorSage Weil <sage@redhat.com>
Fri, 31 Aug 2018 20:35:59 +0000 (15:35 -0500)
committerSage Weil <sage@redhat.com>
Thu, 6 Sep 2018 15:28:45 +0000 (10:28 -0500)
Capture up/down and in/out changes in encode_pending() so we don't have
to worry about the zillions of places and ways pending_inc can get
updated.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc

index 7403a9a903c60bc46ff1c25014e5779cb89eeb54..9c77f9fe751e6065b000442622e365703ba8ef2a 100644 (file)
@@ -1059,9 +1059,26 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
       dout(10) << "new_state for osd." << p->first << " is 0, removing" << dendl;
       p = pending_inc.new_state.erase(p);
     } else {
+      if (p->second & CEPH_OSD_UP) {
+       pending_inc.new_last_up_change = pending_inc.modified;
+      }
       ++p;
     }
   }
+  if (!pending_inc.new_up_client.empty()) {
+    pending_inc.new_last_up_change = pending_inc.modified;
+  }
+  for (auto& i : pending_inc.new_weight) {
+    if (i.first > osdmap.max_osd) {
+      if (i.second) {
+       // new osd is already marked in
+       pending_inc.new_last_in_change = pending_inc.modified;
+      }
+    } else if (!!i.second != !!osdmap.osd_weight[i.first]) {
+      // existing osd marked in or out
+      pending_inc.new_last_in_change = pending_inc.modified;
+    }
+  }
 
   {
     OSDMap tmp;