]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: remove osd_epochs if osd is marked in or out 38041/head
authorKefu Chai <kchai@redhat.com>
Thu, 12 Nov 2020 13:49:06 +0000 (21:49 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 12 Nov 2020 13:50:38 +0000 (21:50 +0800)
this is a cleanup. if we don't take the osd_epochs of osd marked out,
there is no need to keep those osd_epochs around anymore. so, in this
change, once the osd is marked in or out, we just drop its osd_epochs
right away.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/OSDMonitor.cc

index e154ed72e004422f6ee0610aa203f1b2d34d6066..f83a9c2fd2a9affb80e91a8e4249834ab59ae297 100644 (file)
@@ -891,9 +891,9 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
        // could be marked up *or* down, but we're too lazy to check which
        last_osd_report.erase(osd_state.first);
       }
-      if (osd_state.second & CEPH_OSD_EXISTS) {
-       // could be created *or* destroyed, but we can safely drop it
-       osd_epochs.erase(osd_state.first);
+      if (osd_state.second & CEPH_OSD_OUT) {
+        // could be marked in *or* out, but we can safely drop it
+        osd_epochs.erase(osd_state.first);
       }
     }
   }
@@ -2281,8 +2281,7 @@ epoch_t OSDMonitor::get_min_last_epoch_clean() const
   // also scan osd epochs
   // don't trim past the oldest reported osd epoch
   for (auto [osd, epoch] : osd_epochs) {
-    if (epoch < floor &&
-        osdmap.is_in(osd)) {
+    if (epoch < floor) {
       floor = epoch;
     }
   }