]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: drop osd_epoch of manually marked out osd
authorKefu Chai <kchai@redhat.com>
Mon, 23 Nov 2020 07:19:59 +0000 (15:19 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 23 Nov 2020 08:00:14 +0000 (16:00 +0800)
this change addresses the regression introduced by
f994925908c720f8e0b3fda2f1fc51ef6e757de3.

in f994925908c720f8e0b3fda2f1fc51ef6e757de3, instead of ignoring the
osd_epoch from non-in OSD, the osd_epochs from osds marked out using
CEPH_OSD_OUT in its osd_state are dropped once they are marked out.

but the change failed to take those OSDs which are marked out manually
into consideration. we mark them out by changing inc.new_weight to
CEPH_OSD_OUT. and mon-last-epoch-clean.sh marks osd.2 out manually for
testing osdmap trimming. hence we have the regression after that change.

in this change, the manually marked out OSDs are also considered, so
their osd_epochs are also dropped in OSDMonitor::update_from_paxos().

Fixes: https://tracker.ceph.com/issues/48320
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/OSDMonitor.cc

index ab240743c880ed5e48fb43f0815584e674604bb0..db71df05f19bc32ef4e6ba9c368102faa525f066 100644 (file)
@@ -896,6 +896,12 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
         osd_epochs.erase(osd_state.first);
       }
     }
+    for (const auto [osd, weight] : inc.new_weight) {
+      if (weight == CEPH_OSD_OUT) {
+        // manually marked out, so drop it
+        osd_epochs.erase(osd);
+      }
+    }
   }
 
   if (t) {