]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: osd_epochs to store only UP osds
authorMatan Breizman <mbreizma@redhat.com>
Wed, 31 Jan 2024 12:48:04 +0000 (12:48 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 31 Jan 2024 12:59:30 +0000 (12:59 +0000)
OUT OSDs can be the primary for a PG via pg_temp. Therfore, we should
consider OUT as valid beacons.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/mon/OSDMonitor.cc

index fe6024a82ea128baeb35704a0ad9eeb889519173..7ec7b616905274d7561af1aa2c56719c73cbaf8d 100644 (file)
@@ -906,12 +906,7 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
       if (state & CEPH_OSD_UP) {
        // could be marked up *or* down, but we're too lazy to check which
        last_osd_report.erase(osd);
-      }
-    }
-    for (auto [osd, weight] : inc.new_weight) {
-      if (weight == CEPH_OSD_OUT) {
-        // manually marked out, so drop it
-        osd_epochs.erase(osd);
+       osd_epochs.erase(osd);
       }
     }
   }
@@ -2292,6 +2287,7 @@ epoch_t OSDMonitor::get_min_last_epoch_clean() const
   // don't trim past the oldest reported osd epoch
   for (auto [osd, epoch] : osd_epochs) {
     if (epoch < floor) {
+      ceph_assert(osdmap.is_up(osd));
       floor = epoch;
     }
   }
@@ -4399,9 +4395,8 @@ bool OSDMonitor::prepare_beacon(MonOpRequestRef op)
 
   last_osd_report[from].first = ceph_clock_now();
   last_osd_report[from].second = beacon->osd_beacon_report_interval;
-  if (osdmap.is_in(from)) {
-    osd_epochs[from] = beacon->version;
-  }
+  ceph_assert(osdmap.is_up(from));
+  osd_epochs[from] = beacon->version;
   for (const auto& pg : beacon->pgs) {
     if (auto* pool = osdmap.get_pg_pool(pg.pool()); pool != nullptr) {
       unsigned pg_num = pool->get_pg_num();