const OSDMap& next,
pg_t pgid)
{
- if (!creating_pgs.pgs.count(pgid)) {
- return;
+ if (mon->monmap->get_required_features().contains_all(
+ ceph::features::mon::FEATURE_LUMINOUS)) {
+ if (!creating_pgs.pgs.count(pgid)) {
+ return;
+ }
+ } else {
+ const auto& pg_map = mon->pgmon()->pg_map;
+ if (!pg_map.creating_pgs.count(pgid)) {
+ return;
+ }
}
vector<int> up, acting;
version_t OSDMonitor::get_trim_to()
{
- {
+ if (mon->monmap->get_required_features().contains_all(
+ ceph::features::mon::FEATURE_LUMINOUS)) {
std::lock_guard<Spinlock> l(creating_pgs_lock);
if (!creating_pgs.pgs.empty()) {
return 0;
}
+ if (!mon->pgmon()->is_readable()) {
+ return 0;
+ }
+ } else {
+ if (!mon->pgmon()->is_readable())
+ return 0;
+ if (mon->pgmon()->pg_map.creating_pgs.empty()) {
+ return 0;
+ }
}
- if (mon->pgmon()->is_readable()) {
+ {
epoch_t floor = mon->pgmon()->pg_map.get_min_last_epoch_clean();
dout(10) << " min_last_epoch_clean " << floor << dendl;
if (g_conf->mon_osd_force_trim_to > 0 &&
});
}
-void PGMonitor::check_sub(Subscription *sub)
+bool PGMonitor::check_sub(Subscription *sub)
{
+ OSDMap& osdmap = mon->osdmon()->osdmap;
if (sub->type == "osd_pg_creates") {
// only send these if the OSD is up. we will check_subs() when they do
// come up so they will get the creates then.
if (sub->session->inst.name.is_osd() &&
- mon->osdmon()->osdmap.is_up(sub->session->inst.name.num())) {
+ osdmap.is_up(sub->session->inst.name.num())) {
sub->next = send_pg_creates(sub->session->inst.name.num(),
sub->session->con.get(),
sub->next);
}
}
+ return true;
}
const set<int>& s, const char *desc, health_status_t sev) const;
void check_subs();
- void check_sub(Subscription *sub);
+ bool check_sub(Subscription *sub);
private:
// no copying allowed