} // anonymous namespace
-void LastEpochClean::Lec::report(ps_t ps, epoch_t last_epoch_clean)
+void LastEpochClean::Lec::report(unsigned pg_num, ps_t ps,
+ epoch_t last_epoch_clean)
{
- if (epoch_by_pg.size() <= ps) {
- epoch_by_pg.resize(ps + 1, 0);
+ if (ps >= pg_num) {
+ // removed PG
+ return;
}
+ epoch_by_pg.resize(pg_num, 0);
const auto old_lec = epoch_by_pg[ps];
if (old_lec >= last_epoch_clean) {
// stale lec
report_by_pool.erase(pool);
}
-void LastEpochClean::report(const pg_t& pg, epoch_t last_epoch_clean)
+void LastEpochClean::report(unsigned pg_num, const pg_t& pg,
+ epoch_t last_epoch_clean)
{
auto& lec = report_by_pool[pg.pool()];
- return lec.report(pg.ps(), last_epoch_clean);
+ return lec.report(pg_num, pg.ps(), last_epoch_clean);
}
epoch_t LastEpochClean::get_lower_bound(const OSDMap& latest) const
osd_epochs[from] = beacon->version;
for (const auto& pg : beacon->pgs) {
- last_epoch_clean.report(pg, beacon->min_last_epoch_clean);
+ if (auto* pool = osdmap.get_pg_pool(pg.pool()); pool != nullptr) {
+ unsigned pg_num = pool->get_pg_num();
+ last_epoch_clean.report(pg_num, pg, beacon->min_last_epoch_clean);
+ }
}
if (osdmap.osd_xinfo[from].last_purged_snaps_scrub <
}
} else /* var != "all" */ {
choices_map_t::const_iterator found = ALL_CHOICES.find(var);
+ if (found == ALL_CHOICES.end()) {
+ ss << "pool '" << poolstr
+ << "': invalid variable: '" << var << "'";
+ r = -EINVAL;
+ goto reply;
+ }
+
osd_pool_get_choices selected = found->second;
if (!p->is_tier() &&