From: Kefu Chai Date: Mon, 23 Nov 2020 07:19:59 +0000 (+0800) Subject: mon/OSDMonitor: drop osd_epoch of manually marked out osd X-Git-Tag: v16.1.0~440^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ecef75210113ffba1b89c061cd470ee321d7a45;p=ceph.git mon/OSDMonitor: drop osd_epoch of manually marked out osd 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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ab240743c880..db71df05f19b 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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) {