}
creating_pgs_t
-OSDMonitor::update_pending_pgs(const OSDMap::Incremental& inc)
+OSDMonitor::update_pending_pgs(const OSDMap::Incremental& inc,
+ const OSDMap& nextmap)
{
dout(10) << __func__ << dendl;
creating_pgs_t pending_creatings;
pending_creatings.last_scan_epoch = osdmap.get_epoch();
}
+ // filter out any pgs that shouldn't exist.
+ {
+ auto i = pending_creatings.pgs.begin();
+ while (i != pending_creatings.pgs.end()) {
+ if (!nextmap.pg_exists(i->first)) {
+ dout(10) << __func__ << " removing pg " << i->first
+ << " which should not exist" << dendl;
+ i = pending_creatings.pgs.erase(i);
+ } else {
+ ++i;
+ }
+ }
+ }
+
// process queue
unsigned max = std::max<int64_t>(1, g_conf->mon_osd_max_creating_pgs);
const auto total = pending_creatings.pgs.size();
pending_metadata_rm.clear();
// and pg creating, also!
- auto pending_creatings = update_pending_pgs(pending_inc);
+ auto pending_creatings = update_pending_pgs(pending_inc, tmp);
bufferlist creatings_bl;
encode(pending_creatings, creatings_bl);
t->put(OSD_PG_CREATING_PREFIX, "creating", creatings_bl);
for (const auto& pg : creating_pgs.pgs) {
int acting_primary = -1;
auto pgid = pg.first;
+ if (!osdmap.pg_exists(pgid)) {
+ dout(20) << __func__ << " ignoring " << pgid << " which should not exist"
+ << dendl;
+ continue;
+ }
auto mapped = pg.second.first;
dout(20) << __func__ << " looking up " << pgid << "@" << mapped << dendl;
mapping.get(pgid, nullptr, nullptr, nullptr, &acting_primary);
creating_pgs_t creating_pgs;
mutable std::mutex creating_pgs_lock;
- creating_pgs_t update_pending_pgs(const OSDMap::Incremental& inc);
+ creating_pgs_t update_pending_pgs(const OSDMap::Incremental& inc,
+ const OSDMap& nextmap);
void trim_creating_pgs(creating_pgs_t *creating_pgs,
const ceph::unordered_map<pg_t,pg_stat_t>& pgm);
unsigned scan_for_creating_pgs(