Skip to content

Commit

Permalink
Merge pull request ceph#38041 from tchaikov/wip-mon-trim-osdmap
Browse files Browse the repository at this point in the history
mon/OSDMonitor: remove osd_epochs if osd is marked in or out

Reviewed-by: Joao Eduardo Luis <[email protected]>
  • Loading branch information
tchaikov authored Nov 16, 2020
2 parents 6497210 + f994925 commit 6441771
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -2294,8 +2294,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;
}
}
Expand Down

0 comments on commit 6441771

Please sign in to comment.